]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/buzzfeed.py
2 from __future__
import unicode_literals
7 from . common
import InfoExtractor
10 class BuzzFeedIE ( InfoExtractor
):
11 _VALID_URL
= r
'https?://(?:www\.)?buzzfeed\.com/[^?#]*?/(?P<id>[^?#]+)'
13 'url' : 'http://www.buzzfeed.com/abagg/this-angry-ram-destroys-a-punching-bag-like-a-boss?utm_term=4ldqpia' ,
15 'id' : 'this-angry-ram-destroys-a-punching-bag-like-a-boss' ,
16 'title' : 'This Angry Ram Destroys A Punching Bag Like A Boss' ,
17 'description' : 'Rambro!' ,
23 'upload_date' : '20141024' ,
24 'uploader_id' : 'Buddhanz1' ,
25 'description' : 'He likes to stay in shape with his heavy bag, he wont stop until its on the ground \n\n Follow Angry Ram on Facebook for regular updates - \n https://www.facebook.com/pages/Angry-Ram/1436897249899558?ref=hl' ,
26 'uploader' : 'Buddhanz' ,
27 'title' : 'Angry Ram destroys a punching bag' ,
31 'url' : 'http://www.buzzfeed.com/sheridanwatson/look-at-this-cute-dog-omg?utm_term=4ldqpia' ,
33 'skip_download' : True , # Got enough YouTube download tests
36 'description' : 'Munchkin the Teddy Bear is back !' ,
37 'title' : 'You Need To Stop What You \' re Doing And Watching This Dog Walk On A Treadmill' ,
43 'upload_date' : '20141124' ,
44 'uploader_id' : 'CindysMunchkin' ,
45 'description' : '© 2014 Munchkin the Shih Tzu \n All rights reserved \n Facebook: http://facebook.com/MunchkintheShihTzu' ,
46 'uploader' : 'Munchkin the Shih Tzu' ,
47 'title' : 'Munchkin the Teddy Bear gets her exercise' ,
52 def _real_extract ( self
, url
):
53 playlist_id
= self
._ match
_ id
( url
)
54 webpage
= self
._ download
_ webpage
( url
, playlist_id
)
56 all_buckets
= re
. findall (
57 r
'(?s)<div class="video-embed[^"]*"..*?rel:bf_bucket_data=\' ([ ^
\' ]+) \' ',
61 for bd_json in all_buckets:
62 bd = json.loads(bd_json)
63 video = bd.get(' video
') or bd.get(' progload_video
')
66 entries.append(self.url_result(video[' url
']))
71 ' title
': self._og_search_title(webpage),
72 ' description
': self._og_search_description(webpage),