mirror of
https://gitlab.com/dstftw/youtube-dl.git
synced 2020-11-16 09:42:26 +00:00
Merge remote-tracking branch 'JohnyMoSwag/master'
This commit is contained in:
commit
af284c6d1b
|
@ -225,6 +225,7 @@ from .tinypic import TinyPicIE
|
||||||
from .toutv import TouTvIE
|
from .toutv import TouTvIE
|
||||||
from .traileraddict import TrailerAddictIE
|
from .traileraddict import TrailerAddictIE
|
||||||
from .trilulilu import TriluliluIE
|
from .trilulilu import TriluliluIE
|
||||||
|
from .trutube import TruTubeIE
|
||||||
from .tube8 import Tube8IE
|
from .tube8 import Tube8IE
|
||||||
from .tudou import TudouIE
|
from .tudou import TudouIE
|
||||||
from .tumblr import TumblrIE
|
from .tumblr import TumblrIE
|
||||||
|
|
43
youtube_dl/extractor/trutube.py
Normal file
43
youtube_dl/extractor/trutube.py
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
import re
|
||||||
|
|
||||||
|
from .common import InfoExtractor
|
||||||
|
from ..utils import (
|
||||||
|
ExtractorError,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class TruTubeIE(InfoExtractor):
|
||||||
|
_VALID_URL = r'(?:https?://)?(?:www\.)?(?P<url>trutube\.tv/video/(?P<videoid>.*/.*))'
|
||||||
|
_TEST = {
|
||||||
|
'url': ('http://www.trutube.tv/video/20814/Ernst-Zundel-met-les-Jui'
|
||||||
|
'fs-en-guarde-VOSTFR'),
|
||||||
|
'md5': '9973aa3c2870626799d2ac4e36cfc3dc',
|
||||||
|
'info_dict': {
|
||||||
|
u"title": u"TruTube.TV - Spitting in the face of die-versity",
|
||||||
|
u"ext": u"mp4"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
mobj = re.match(self._VALID_URL, url)
|
||||||
|
|
||||||
|
video_id = mobj.group('videoid')
|
||||||
|
|
||||||
|
# Get webpage content
|
||||||
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
|
# Get the video title
|
||||||
|
video_title = self._html_search_regex(r'<title>(?P<title>.*)</title>',
|
||||||
|
webpage, 'title').strip()
|
||||||
|
|
||||||
|
video_url = self._search_regex(r'(http://.*\.(?:mp4|flv))',
|
||||||
|
webpage, u'video URL')
|
||||||
|
|
||||||
|
ext = video_url[-3:]
|
||||||
|
|
||||||
|
return {
|
||||||
|
'id': video_id,
|
||||||
|
'url': video_url,
|
||||||
|
'title': video_title,
|
||||||
|
'ext': ext
|
||||||
|
}
|
|
@ -22,8 +22,8 @@ class WorldStarHipHopIE(InfoExtractor):
|
||||||
webpage_src = self._download_webpage(url, video_id)
|
webpage_src = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
m_vevo_id = re.search(r'videoId=(.*?)&?',
|
m_vevo_id = re.search(r'videoId=(.*?)&?',
|
||||||
webpage_src)
|
webpage_src)
|
||||||
|
|
||||||
if m_vevo_id is not None:
|
if m_vevo_id is not None:
|
||||||
self.to_screen(u'Vevo video detected:')
|
self.to_screen(u'Vevo video detected:')
|
||||||
return self.url_result('vevo:%s' % m_vevo_id.group(1), ie='Vevo')
|
return self.url_result('vevo:%s' % m_vevo_id.group(1), ie='Vevo')
|
||||||
|
|
Loading…
Reference in a new issue