]>
 
 
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/cinemassacre.py 
 
 
 
 
 
 
 
 
   2  from  __future__ 
import  unicode_literals
 
   6  from  . common 
import  InfoExtractor
 
   7  from  .. utils 
import  ExtractorError
 
   8  from  . screenwavemedia 
import  ScreenwaveMediaIE
 
  11  class  CinemassacreIE ( InfoExtractor
):  
  12      _VALID_URL 
=  'https?://(?:www\.)?cinemassacre\.com/(?P<date_y>[0-9] {4} )/(?P<date_m>[0-9] {2} )/(?P<date_d>[0-9] {2} )/(?P<display_id>[^?#/]+)'  
  15              'url' :  'http://cinemassacre.com/2012/11/10/avgn-the-movie-trailer/' ,  
  16              'md5' :  'fde81fbafaee331785f58cd6c0d46190' ,  
  18                  'id' :  'Cinemassacre-19911' ,  
  20                  'upload_date' :  '20121110' ,  
  21                  'title' :  '“Angry Video Game Nerd: The Movie” – Trailer' ,  
  22                  'description' :  'md5:fb87405fcb42a331742a0dce2708560b' ,  
  26              'url' :  'http://cinemassacre.com/2013/10/02/the-mummys-hand-1940' ,  
  27              'md5' :  'd72f10cd39eac4215048f62ab477a511' ,  
  29                  'id' :  'Cinemassacre-521be8ef82b16' ,  
  31                  'upload_date' :  '20131002' ,  
  32                  'title' :  'The Mummy’s Hand (1940)' ,  
  36              # Youtube embedded video  
  37              'url' :  'http://cinemassacre.com/2006/12/07/chronologically-confused-about-bad-movie-and-video-game-sequel-titles/' ,  
  38              'md5' :  'df4cf8a1dcedaec79a73d96d83b99023' ,  
  42                  'title' :  'AVGN: Chronologically Confused about Bad Movie and Video Game Sequel Titles' ,  
  43                  'upload_date' :  '20061207' ,  
  44                  'uploader' :  'Cinemassacre' ,  
  45                  'uploader_id' :  'JamesNintendoNerd' ,  
  46                  'description' :  'md5:784734696c2b8b7f4b8625cc799e07f6' ,  
  50              # Youtube embedded video  
  51              'url' :  'http://cinemassacre.com/2006/09/01/mckids/' ,  
  52              'md5' :  '6eb30961fa795fedc750eac4881ad2e1' ,  
  56                  'upload_date' :  '20060901' ,  
  57                  'uploader' :  'Cinemassacre Extras' ,  
  58                  'description' :  'md5:de9b751efa9e45fbaafd9c8a1123ed53' ,  
  59                  'uploader_id' :  'Cinemassacre' ,  
  60                  'title' :  'AVGN: McKids' ,  
  64              'url' :  'http://cinemassacre.com/2015/05/25/mario-kart-64-nintendo-64-james-mike-mondays/' ,  
  65              'md5' :  '1376908e49572389e7b06251a53cdd08' ,  
  67                  'id' :  'Cinemassacre-555779690c440' ,  
  69                  'description' :  'Let’s Play Mario Kart 64 !! Mario Kart 64 is a classic go-kart racing game released for the Nintendo 64 (N64). Today James & Mike do 4 player Battle Mode with Kyle and Bootsy!' ,  
  70                  'title' :  'Mario Kart 64 (Nintendo 64) James & Mike Mondays' ,  
  71                  'upload_date' :  '20150525' ,  
  76      def  _real_extract ( self
,  url
):  
  77          mobj 
=  re
. match ( self
._ VALID
_U RL
,  url
)  
  78          display_id 
=  mobj
. group ( 'display_id' )  
  79          video_date 
=  mobj
. group ( 'date_y' ) +  mobj
. group ( 'date_m' ) +  mobj
. group ( 'date_d' )  
  81          webpage 
=  self
._ download
_ webpage
( url
,  display_id
)  
  83          playerdata_url 
=  self
._ search
_ regex
(  
  85                  ScreenwaveMediaIE
. EMBED_PATTERN
,  
  86                  r
'<iframe[^>]+src="(?P<url>(?:https?:)?//(?:[^.]+\.)?youtube\.com/.+?)"' ,  
  88              webpage
,  'player data URL' ,  default
= None ,  group
= 'url' )  
  89          if not  playerdata_url
:  
  90              raise  ExtractorError ( 'Unable to find player data' )  
  92          video_title 
=  self
._ html
_ search
_ regex
(  
  93              r
'<title>(?P<title>.+?)\|' ,  webpage
,  'title' )  
  94          video_description 
=  self
._ html
_ search
_ regex
(  
  95              r
'<div class="entry-content">(?P<description>.+?)</div>' ,  
  96              webpage
,  'description' ,  flags
= re
. DOTALL
,  fatal
= False )  
  97          video_thumbnail 
=  self
._ og
_ search
_ thumbnail
( webpage
)  
 100              '_type' :  'url_transparent' ,  
 101              'display_id' :  display_id
,  
 102              'title' :  video_title
,  
 103              'description' :  video_description
,  
 104              'upload_date' :  video_date
,  
 105              'thumbnail' :  video_thumbnail
,  
 106              'url' :  playerdata_url
,