]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/gamestar.py
50f8fc7e77c83ad63a05e9a312a9ff5b3afd8983
2 from __future__
import unicode_literals
6 from . common
import InfoExtractor
15 class GameStarIE ( InfoExtractor
):
16 _VALID_URL
= r
'http://www\.gamestar\.de/videos/.*,(?P<id>[0-9]+)\.html'
18 'url' : 'http://www.gamestar.de/videos/trailer,3/hobbit-3-die-schlacht-der-fuenf-heere,76110.html' ,
19 'md5' : '96974ecbb7fd8d0d20fca5a00810cea7' ,
23 'title' : 'Hobbit 3: Die Schlacht der Fünf Heere - Teaser-Trailer zum dritten Teil' ,
24 'description' : 'Der Teaser-Trailer zu Hobbit 3: Die Schlacht der Fünf Heere zeigt einige Szenen aus dem dritten Teil der Saga und kündigt den vollständigen Trailer an.' ,
25 'thumbnail' : 'http://images.gamestar.de/images/idgwpgsgp/bdb/2494525/600x.jpg' ,
26 'upload_date' : '20140728' ,
31 def _real_extract ( self
, url
):
32 mobj
= re
. match ( self
._ VALID
_U RL
, url
)
33 video_id
= mobj
. group ( 'id' )
35 webpage
= self
._ download
_ webpage
( url
, video_id
)
37 og_title
= self
._ og
_ search
_ title
( webpage
)
38 title
= og_title
. replace ( ' - Video bei GameStar.de' , '' ). strip ()
40 url
= 'http://gamestar.de/_misc/videos/portal/getVideoUrl.cfm?premium=0&videoId=' + video_id
42 description
= self
._ og
_ search
_ description
( webpage
). strip ()
44 thumbnail
= self
._ proto
_ relative
_u rl
(
45 self
._ og
_ search
_ thumbnail
( webpage
), scheme
= 'http:' )
47 upload_date
= unified_strdate ( self
._ html
_ search
_ regex
(
48 r
'<span style="float:left;font-size:11px;">Datum: ([0-9]+\.[0-9]+\.[0-9]+) ' ,
49 webpage
, 'upload_date' , fatal
= False ))
51 duration
= parse_duration ( self
._ html
_ search
_ regex
(
52 r
' Länge: ([0-9]+:[0-9]+)</span>' , webpage
, 'duration' ,
55 view_count
= str_to_int ( self
._ html
_ search
_ regex
(
56 r
' Zuschauer: ([0-9\.]+) ' , webpage
,
57 'view_count' , fatal
= False ))
59 comment_count
= int_or_none ( self
._ html
_ search
_ regex
(
60 r
'>Kommentieren \(([0-9]+)\)</a>' , webpage
, 'comment_count' ,
68 'thumbnail' : thumbnail
,
69 'description' : description
,
70 'upload_date' : upload_date
,
72 'view_count' : view_count
,
73 'comment_count' : comment_count