]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/tmz.py
2 from __future__
import unicode_literals
6 from . common
import InfoExtractor
9 get_element_by_attribute
,
13 class TMZIE ( InfoExtractor
):
14 _VALID_URL
= r
"https?://(?:www\.)?tmz\.com/.*"
17 "url" : "http://www.tmz.com/videos/0-cegprt2p/" ,
19 "id" : "http://www.tmz.com/videos/0-cegprt2p/" ,
21 "title" : "No Charges Against Hillary Clinton? Harvey Says It Ain't Over Yet" ,
22 "description" : "Harvey talks about Director Comey’s decision not to prosecute Hillary Clinton." ,
23 "timestamp" : 1467831837 ,
24 "uploader" : " {'@type': 'Person', 'name': 'TMZ Staff'} " ,
25 "upload_date" : "20160706" ,
29 "url" : "https://www.tmz.com/videos/071119-chris-morgan-women-4590005-0-zcsejvcr/" ,
31 "id" : "https://www.tmz.com/videos/071119-chris-morgan-women-4590005-0-zcsejvcr/" ,
33 "title" : "Angry Bagel Shop Guy Says He Doesn't Trust Women" ,
34 "description" : "The enraged man who went viral for ranting about women on dating sites before getting ragdolled in a bagel shop is defending his misogyny ... he says it's women's fault in the first place." ,
35 "timestamp" : 1562889485 ,
36 "uploader" : " {'@type': 'Person', 'name': 'TMZ Staff'} " ,
37 "upload_date" : "20190711" ,
41 "url" : "http://www.tmz.com/2015/04/19/bobby-brown-bobbi-kristina-awake-video-concert" ,
42 "md5" : "5429c85db8bde39a473a56ca8c4c5602" ,
44 "id" : "http://www.tmz.com/2015/04/19/bobby-brown-bobbi-kristina-awake-video-concert" ,
46 "title" : "Bobby Brown Tells Crowd ... Bobbi Kristina is Awake" ,
47 "description" : 'Bobby Brown stunned his audience during a concert Saturday night, when he told the crowd, "Bobbi is awake. She \' s watching me."' ,
48 "timestamp" : 1429467813 ,
49 "uploader" : " {'@type': 'Person', 'name': 'TMZ Staff'} " ,
50 "upload_date" : "20150419" ,
54 "url" : "http://www.tmz.com/2015/09/19/patti-labelle-concert-fan-stripping-kicked-out-nicki-minaj/" ,
56 "id" : "http://www.tmz.com/2015/09/19/patti-labelle-concert-fan-stripping-kicked-out-nicki-minaj/" ,
58 "title" : "Patti LaBelle -- Goes Nuclear On Stripping Fan" ,
59 "description" : "Patti LaBelle made it known loud and clear last night ... NO "
60 "ONE gets on her stage and strips down." ,
61 "timestamp" : 1442683746 ,
62 "uploader" : " {'@type': 'Person', 'name': 'TMZ Staff'} " ,
63 "upload_date" : "20150919" ,
67 "url" : "http://www.tmz.com/2016/01/28/adam-silver-sting-drake-blake-griffin/" ,
69 "id" : "http://www.tmz.com/2016/01/28/adam-silver-sting-drake-blake-griffin/" ,
71 "title" : "NBA's Adam Silver -- Blake Griffin's a Great Guy ... He'll Learn from This" ,
72 "description" : "Two pretty parts of this video with NBA Commish Adam Silver." ,
73 "timestamp" : 1454010989 ,
74 "uploader" : " {'@type': 'Person', 'name': 'TMZ Staff'} " ,
75 "upload_date" : "20160128" ,
79 "url" : "http://www.tmz.com/2016/10/27/donald-trump-star-vandal-arrested-james-otis/" ,
81 "id" : "http://www.tmz.com/2016/10/27/donald-trump-star-vandal-arrested-james-otis/" ,
83 "title" : "Trump Star Vandal -- I'm Not Afraid of Donald or the Cops!" ,
84 "description" : "James Otis is the the guy who took a pickaxe to Donald Trump's star on the Walk of Fame, and he tells TMZ .. he's ready and willing to go to jail for the crime." ,
85 "timestamp" : 1477500095 ,
86 "uploader" : " {'@type': 'Person', 'name': 'TMZ Staff'} " ,
87 "upload_date" : "20161026" ,
91 "url" : "https://www.tmz.com/videos/2020-10-31-103120-beverly-hills-protest-4878209/" ,
93 "id" : "https://www.tmz.com/videos/2020-10-31-103120-beverly-hills-protest-4878209/" ,
95 "title" : "Cops Use Billy Clubs Against Pro-Trump and Anti-Fascist "
97 "description" : "Beverly Hills may be an omen of what's coming next week, "
98 "because things got crazy on the streets and cops started "
99 "swinging their billy clubs at both Anti-Fascist and Pro-Trump "
101 "timestamp" : 1604182772 ,
102 "uploader" : " {'@type': 'Person', 'name': 'TMZ Staff'} " ,
103 "upload_date" : "20201031" ,
107 "url" : "https://www.tmz.com/2020/11/05/gervonta-davis-car-crash-hit-and-run-police/" ,
111 "title" : "SICK LAMBO GERVONTA DAVIS IN HIS NEW RIDE RIGHT AFTER KO AFTER LEO EsNews Boxing" ,
112 "uploader" : "ESNEWS" ,
113 "description" : "md5:49675bc58883ccf80474b8aa701e1064" ,
114 "upload_date" : "20201101" ,
115 "uploader_id" : "ESNEWS" ,
119 "url" : "https://www.tmz.com/2020/11/19/conor-mcgregor-dustin-poirier-contract-fight-ufc-257-fight-island/" ,
121 "id" : "1329450007125225473" ,
123 "title" : "TheMacLife - BREAKING: Conor McGregor (@thenotoriousmma) has signed his bout agreement for his rematch with Dustin Poirier for January 23." ,
124 "uploader" : "TheMacLife" ,
125 "description" : "md5:56e6009bbc3d12498e10d08a8e1f1c69" ,
126 "upload_date" : "20201119" ,
127 "uploader_id" : "Maclifeofficial" ,
128 "timestamp" : 1605800556 ,
133 def _real_extract ( self
, url
):
134 webpage
= self
._ download
_ webpage
( url
, url
)
135 jsonld
= self
._ search
_ json
_l d
( webpage
, url
)
136 if not jsonld
or "url" not in jsonld
:
137 # try to extract from YouTube Player API
138 # see https://developers.google.com/youtube/iframe_api_reference#Video_Queueing_Functions
139 match_obj
= re
. search ( r
'\.cueVideoById\(\s*(?P<quote>[\' "])(?P<id>.*?)(?P=quote)', webpage)
141 res = self.url_result(match_obj.group(" id "))
143 # try to extract from twitter
144 blockquote_el = get_element_by_attribute(" class ", " twitter
- tweet
", webpage)
146 matches = re.findall(
147 r'<a[^>]+href=\s*(?P<quote>[ \' " ])( ?P
< link
>.* ?
)( ?P
= quote
) ',
150 for _, match in matches:
151 if "/status/" in match:
152 res = self.url_result(match)
154 raise ExtractorError("No video found!")