4 from .common
import InfoExtractor
5 from .facebook
import FacebookIE
8 class BuzzFeedIE(InfoExtractor
):
9 _VALID_URL
= r
'https?://(?:www\.)?buzzfeed\.com/[^?#]*?/(?P<id>[^?#]+)'
11 'url': 'http://www.buzzfeed.com/abagg/this-angry-ram-destroys-a-punching-bag-like-a-boss?utm_term=4ldqpia',
13 'id': 'this-angry-ram-destroys-a-punching-bag-like-a-boss',
14 'title': 'This Angry Ram Destroys A Punching Bag Like A Boss',
15 'description': 'Rambro!',
21 'title': 'Angry Ram destroys a punching bag..',
22 'description': 'md5:c59533190ef23fd4458a5e8c8c872345',
23 'upload_date': '20141024',
24 'uploader_id': 'Buddhanz1',
25 'uploader': 'Angry Ram',
29 'url': 'http://www.buzzfeed.com/sheridanwatson/look-at-this-cute-dog-omg?utm_term=4ldqpia',
31 'skip_download': True, # Got enough YouTube download tests
34 'id': 'look-at-this-cute-dog-omg',
35 'description': 're:Munchkin the Teddy Bear is back ?!',
36 'title': 'You Need To Stop What You\'re Doing And Watching This Dog Walk On A Treadmill',
42 'title': 're:Munchkin the Teddy Bear gets her exercise',
43 'description': 'md5:28faab95cda6e361bcff06ec12fc21d8',
44 'upload_date': '20141124',
45 'uploader_id': 'CindysMunchkin',
46 'uploader': 're:^Munchkin the',
50 'url': 'http://www.buzzfeed.com/craigsilverman/the-most-adorable-crash-landing-ever#.eq7pX0BAmK',
52 'id': 'the-most-adorable-crash-landing-ever',
53 'title': 'Watch This Baby Goose Make The Most Adorable Crash Landing',
54 'description': 'This gosling knows how to stick a landing.',
57 'md5': '763ca415512f91ca62e4621086900a23',
59 'id': '971793786185728',
61 'title': 'We set up crash pads so that the goslings on our roof would have a safe landi...',
62 'uploader': 'Calgary Outdoor Centre-University of Calgary',
65 'add_ie': ['Facebook'],
68 def _real_extract(self
, url
):
69 playlist_id
= self
._match
_id
(url
)
70 webpage
= self
._download
_webpage
(url
, playlist_id
)
72 all_buckets
= re
.findall(
73 r
'(?s)<div class="video-embed[^"]*"..*?rel:bf_bucket_data=\'([^
\']+)\'',
77 for bd_json in all_buckets:
78 bd = json.loads(bd_json)
79 video = bd.get('video
') or bd.get('progload_video
')
82 entries.append(self.url_result(video['url
']))
84 facebook_urls = FacebookIE._extract_embed_urls(url, webpage)
86 self.url_result(facebook_url)
87 for facebook_url in facebook_urls])
92 'title
': self._og_search_title(webpage),
93 'description
': self._og_search_description(webpage),