]>
 
 
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              'id' :  'look-at-this-cute-dog-omg' ,  
  37              'description' :  're:Munchkin the Teddy Bear is back ?!' ,  
  38              'title' :  'You Need To Stop What You \' re Doing And Watching This Dog Walk On A Treadmill' ,  
  44                  'upload_date' :  '20141124' ,  
  45                  'uploader_id' :  'CindysMunchkin' ,  
  46                  'description' :  're:© 2014 Munchkin the' ,  
  47                  'uploader' :  're:^Munchkin the' ,  
  48                  'title' :  're:Munchkin the Teddy Bear gets her exercise' ,  
  53      def  _real_extract ( self
,  url
):  
  54          playlist_id 
=  self
._ match
_ id
( url
)  
  55          webpage 
=  self
._ download
_ webpage
( url
,  playlist_id
)  
  57          all_buckets 
=  re
. findall (  
  58              r
'(?s)<div class="video-embed[^"]*"..*?rel:bf_bucket_data=\' ([ ^
\' ]+) \' ',  
  62          for bd_json in all_buckets:  
  63              bd = json.loads(bd_json)  
  64              video = bd.get(' video
') or bd.get(' progload_video
')  
  67              entries.append(self.url_result(video[' url
']))  
  72              ' title
': self._og_search_title(webpage),  
  73              ' description
': self._og_search_description(webpage),