1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-03-13 01:07:21 +08:00

Merge branch 'master' into NBC-issue-13873

This commit is contained in:
Parmjit Virk 2017-09-19 17:13:48 -05:00
commit aedd566ba5
3 changed files with 21 additions and 7 deletions

View File

@ -14,7 +14,7 @@ import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import get_testcases
from test.helper import gettestcases
from youtube_dl.utils import compat_urllib_parse_urlparse
from youtube_dl.utils import compat_urllib_request
@ -24,7 +24,7 @@ if len(sys.argv) > 1:
else:
METHOD = 'EURISTIC'
for test in get_testcases():
for test in gettestcases():
if METHOD == 'EURISTIC':
try:
webpage = compat_urllib_request.urlopen(test['url'], timeout=10).read()

View File

@ -15,7 +15,9 @@ from ..utils import (
int_or_none,
parse_iso8601,
qualities,
smuggle_url,
try_get,
unsmuggle_url,
update_url_query,
)
@ -224,6 +226,9 @@ class TVPlayIE(InfoExtractor):
]
def _real_extract(self, url):
url, smuggled_data = unsmuggle_url(url, {})
self._initialize_geo_bypass(smuggled_data.get('geo_countries'))
video_id = self._match_id(url)
geo_country = self._search_regex(
r'https?://[^/]+\.([a-z]{2})', url,
@ -426,4 +431,9 @@ class ViafreeIE(InfoExtractor):
r'currentVideo["\']\s*:\s*.+?["\']id["\']\s*:\s*["\'](\d{6,})',
webpage, 'video id')
return self.url_result('mtg:%s' % video_id, TVPlayIE.ie_key())
return self.url_result(
smuggle_url(
'mtg:%s' % video_id,
{'geo_countries': [
compat_urlparse.urlparse(url).netloc.rsplit('.', 1)[-1]]}),
ie=TVPlayIE.ie_key(), video_id=video_id)

View File

@ -229,7 +229,7 @@ class TwitterCardIE(TwitterBaseIE):
title = self._search_regex(r'<title>([^<]+)</title>', webpage, 'title')
thumbnail = config.get('posterImageUrl') or config.get('image_src')
duration = float_or_none(config.get('duration')) or duration
duration = float_or_none(config.get('duration'), scale=1000) or duration
return {
'id': video_id,
@ -255,6 +255,7 @@ class TwitterIE(InfoExtractor):
'description': 'FREE THE NIPPLE on Twitter: "FTN supporters on Hollywood Blvd today! http://t.co/c7jHH749xJ"',
'uploader': 'FREE THE NIPPLE',
'uploader_id': 'freethenipple',
'duration': 12.922,
},
'params': {
'skip_download': True, # requires ffmpeg
@ -305,11 +306,12 @@ class TwitterIE(InfoExtractor):
'info_dict': {
'id': '700207533655363584',
'ext': 'mp4',
'title': 'Donte - BEAT PROD: @suhmeduh #Damndaniel',
'description': 'Donte on Twitter: "BEAT PROD: @suhmeduh https://t.co/HBrQ4AfpvZ #Damndaniel https://t.co/byBooq2ejZ"',
'title': 'あかさ - BEAT PROD: @suhmeduh #Damndaniel',
'description': 'あかさ on Twitter: "BEAT PROD: @suhmeduh https://t.co/HBrQ4AfpvZ #Damndaniel https://t.co/byBooq2ejZ"',
'thumbnail': r're:^https?://.*\.jpg',
'uploader': 'Donte',
'uploader': 'あかさ',
'uploader_id': 'jaydingeer',
'duration': 30.0,
},
'params': {
'skip_download': True, # requires ffmpeg
@ -337,6 +339,7 @@ class TwitterIE(InfoExtractor):
'description': 'Captain America on Twitter: "@King0fNerd Are you sure you made the right choice? Find out in theaters. https://t.co/GpgYi9xMJI"',
'uploader_id': 'captainamerica',
'uploader': 'Captain America',
'duration': 3.17,
},
'params': {
'skip_download': True, # requires ffmpeg
@ -364,6 +367,7 @@ class TwitterIE(InfoExtractor):
'description': 'عالم الأخبار on Twitter: "كلمة تاريخية بجلسة الجناسي التاريخية.. النائب خالد مؤنس العتيبي للمعارضين : اتقوا الله .. الظلم ظلمات يوم القيامة https://t.co/xg6OhpyKfN"',
'uploader': 'عالم الأخبار',
'uploader_id': 'news_al3alm',
'duration': 277.4,
},
'params': {
'format': 'best[format_id^=http-]',