Update clyp.py
This commit is contained in:
parent
3fce765491
commit
8e92344030
@ -7,8 +7,8 @@ import re
|
|||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
|
|
||||||
|
|
||||||
class JeuxVideoIE(InfoExtractor):
|
class ClypIE(InfoExtractor):
|
||||||
_VALID_URL = r'http://.*?\.jeuxvideo\.com/.*/(.*?)\.htm'
|
_VALID_URL = r'https://clyp\.it/........'
|
||||||
|
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'http://www.jeuxvideo.com/reportages-videos-jeux/0004/00046170/tearaway-playstation-vita-gc-2013-tearaway-nous-presente-ses-papiers-d-identite-00115182.htm',
|
'url': 'http://www.jeuxvideo.com/reportages-videos-jeux/0004/00046170/tearaway-playstation-vita-gc-2013-tearaway-nous-presente-ses-papiers-d-identite-00115182.htm',
|
||||||
@ -25,9 +25,10 @@ class JeuxVideoIE(InfoExtractor):
|
|||||||
}]
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
mobj = re.match(self._VALID_URL, url)
|
video_id = url.replace("https://clyp.it/", "")
|
||||||
title = mobj.group(1)
|
api_url = 'https://api.clyp.it/' + video_id
|
||||||
webpage = self._download_webpage(url, title)
|
metadata = self._download_json(api_url, video_id)
|
||||||
|
print metadata
|
||||||
title = self._html_search_meta('name', webpage)
|
title = self._html_search_meta('name', webpage)
|
||||||
if title == None:
|
if title == None:
|
||||||
title = 'untitled'
|
title = 'untitled'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user