]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/tmz.py
3 from . common
import InfoExtractor
6 get_element_by_attribute
,
10 class TMZIE ( InfoExtractor
):
11 _VALID_URL
= r
"https?://(?:www\.)?tmz\.com/.*"
14 "url" : "http://www.tmz.com/videos/0-cegprt2p/" ,
16 "id" : "http://www.tmz.com/videos/0-cegprt2p/" ,
18 "title" : "No Charges Against Hillary Clinton? Harvey Says It Ain't Over Yet" ,
19 "description" : "Harvey talks about Director Comey’s decision not to prosecute Hillary Clinton." ,
20 "timestamp" : 1467831837 ,
21 "uploader" : " {'@type': 'Person', 'name': 'TMZ Staff'} " ,
22 "upload_date" : "20160706" ,
26 "url" : "https://www.tmz.com/videos/071119-chris-morgan-women-4590005-0-zcsejvcr/" ,
28 "id" : "https://www.tmz.com/videos/071119-chris-morgan-women-4590005-0-zcsejvcr/" ,
30 "title" : "Angry Bagel Shop Guy Says He Doesn't Trust Women" ,
31 "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." ,
32 "timestamp" : 1562889485 ,
33 "uploader" : " {'@type': 'Person', 'name': 'TMZ Staff'} " ,
34 "upload_date" : "20190711" ,
38 "url" : "http://www.tmz.com/2015/04/19/bobby-brown-bobbi-kristina-awake-video-concert" ,
39 "md5" : "5429c85db8bde39a473a56ca8c4c5602" ,
41 "id" : "http://www.tmz.com/2015/04/19/bobby-brown-bobbi-kristina-awake-video-concert" ,
43 "title" : "Bobby Brown Tells Crowd ... Bobbi Kristina is Awake" ,
44 "description" : 'Bobby Brown stunned his audience during a concert Saturday night, when he told the crowd, "Bobbi is awake. She \' s watching me."' ,
45 "timestamp" : 1429467813 ,
46 "uploader" : " {'@type': 'Person', 'name': 'TMZ Staff'} " ,
47 "upload_date" : "20150419" ,
51 "url" : "http://www.tmz.com/2015/09/19/patti-labelle-concert-fan-stripping-kicked-out-nicki-minaj/" ,
53 "id" : "http://www.tmz.com/2015/09/19/patti-labelle-concert-fan-stripping-kicked-out-nicki-minaj/" ,
55 "title" : "Patti LaBelle -- Goes Nuclear On Stripping Fan" ,
56 "description" : "Patti LaBelle made it known loud and clear last night ... NO "
57 "ONE gets on her stage and strips down." ,
58 "timestamp" : 1442683746 ,
59 "uploader" : " {'@type': 'Person', 'name': 'TMZ Staff'} " ,
60 "upload_date" : "20150919" ,
64 "url" : "http://www.tmz.com/2016/01/28/adam-silver-sting-drake-blake-griffin/" ,
66 "id" : "http://www.tmz.com/2016/01/28/adam-silver-sting-drake-blake-griffin/" ,
68 "title" : "NBA's Adam Silver -- Blake Griffin's a Great Guy ... He'll Learn from This" ,
69 "description" : "Two pretty parts of this video with NBA Commish Adam Silver." ,
70 "timestamp" : 1454010989 ,
71 "uploader" : " {'@type': 'Person', 'name': 'TMZ Staff'} " ,
72 "upload_date" : "20160128" ,
76 "url" : "http://www.tmz.com/2016/10/27/donald-trump-star-vandal-arrested-james-otis/" ,
78 "id" : "http://www.tmz.com/2016/10/27/donald-trump-star-vandal-arrested-james-otis/" ,
80 "title" : "Trump Star Vandal -- I'm Not Afraid of Donald or the Cops!" ,
81 "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." ,
82 "timestamp" : 1477500095 ,
83 "uploader" : " {'@type': 'Person', 'name': 'TMZ Staff'} " ,
84 "upload_date" : "20161026" ,
88 "url" : "https://www.tmz.com/videos/2020-10-31-103120-beverly-hills-protest-4878209/" ,
90 "id" : "https://www.tmz.com/videos/2020-10-31-103120-beverly-hills-protest-4878209/" ,
92 "title" : "Cops Use Billy Clubs Against Pro-Trump and Anti-Fascist "
94 "description" : "Beverly Hills may be an omen of what's coming next week, "
95 "because things got crazy on the streets and cops started "
96 "swinging their billy clubs at both Anti-Fascist and Pro-Trump "
98 "timestamp" : 1604182772 ,
99 "uploader" : " {'@type': 'Person', 'name': 'TMZ Staff'} " ,
100 "upload_date" : "20201031" ,
104 "url" : "https://www.tmz.com/2020/11/05/gervonta-davis-car-crash-hit-and-run-police/" ,
108 "title" : "SICK LAMBO GERVONTA DAVIS IN HIS NEW RIDE RIGHT AFTER KO AFTER LEO EsNews Boxing" ,
109 "uploader" : "ESNEWS" ,
110 "description" : "md5:49675bc58883ccf80474b8aa701e1064" ,
111 "upload_date" : "20201101" ,
112 "uploader_id" : "ESNEWS" ,
116 "url" : "https://www.tmz.com/2020/11/19/conor-mcgregor-dustin-poirier-contract-fight-ufc-257-fight-island/" ,
118 "id" : "1329450007125225473" ,
120 "title" : "TheMacLife - BREAKING: Conor McGregor (@thenotoriousmma) has signed his bout agreement for his rematch with Dustin Poirier for January 23." ,
121 "uploader" : "TheMacLife" ,
122 "description" : "md5:56e6009bbc3d12498e10d08a8e1f1c69" ,
123 "upload_date" : "20201119" ,
124 "uploader_id" : "Maclifeofficial" ,
125 "timestamp" : 1605800556 ,
130 def _real_extract ( self
, url
):
131 webpage
= self
._ download
_ webpage
( url
, url
)
132 jsonld
= self
._ search
_ json
_l d
( webpage
, url
)
133 if not jsonld
or "url" not in jsonld
:
134 # try to extract from YouTube Player API
135 # see https://developers.google.com/youtube/iframe_api_reference#Video_Queueing_Functions
136 match_obj
= re
. search ( r
'\.cueVideoById\(\s*(?P<quote>[\' "])(?P<id>.*?)(?P=quote)', webpage)
138 res = self.url_result(match_obj.group(" id "))
140 # try to extract from twitter
141 blockquote_el = get_element_by_attribute(" class ", " twitter
- tweet
", webpage)
143 matches = re.findall(
144 r'<a[^>]+href=\s*(?P<quote>[ \' " ])( ?P
< link
>.* ?
)( ?P
= quote
) ',
147 for _, match in matches:
148 if "/status/" in match:
149 res = self.url_result(match)
151 raise ExtractorError("No video found!")