mirror of
https://github.com/ytdl-org/youtube-dl
synced 2025-01-26 13:20:10 +09:00
Compare commits
No commits in common. "164a4a5756f5a29b928dc1351522c094c0026266" and "c29500e4126fc2d9d8b9f6fd02b557d8500f597c" have entirely different histories.
164a4a5756
...
c29500e412
@ -9,7 +9,7 @@ import re
|
|||||||
import time
|
import time
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
# from .anvato_token_generator import NFLTokenGenerator
|
from .anvato_token_generator import NFLTokenGenerator
|
||||||
from ..aes import aes_encrypt
|
from ..aes import aes_encrypt
|
||||||
from ..compat import compat_str
|
from ..compat import compat_str
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
@ -205,7 +205,7 @@ class AnvatoIE(InfoExtractor):
|
|||||||
}
|
}
|
||||||
|
|
||||||
_TOKEN_GENERATORS = {
|
_TOKEN_GENERATORS = {
|
||||||
# 'GXvEgwyJeWem8KCYXfeoHWknwP48Mboj': NFLTokenGenerator,
|
'GXvEgwyJeWem8KCYXfeoHWknwP48Mboj': NFLTokenGenerator,
|
||||||
}
|
}
|
||||||
|
|
||||||
_API_KEY = '3hwbSuqqT690uxjNYBktSQpa5ZrpYYR0Iofx7NcJHyA'
|
_API_KEY = '3hwbSuqqT690uxjNYBktSQpa5ZrpYYR0Iofx7NcJHyA'
|
||||||
|
@ -1530,6 +1530,7 @@ from .youtube import (
|
|||||||
YoutubeWatchLaterIE,
|
YoutubeWatchLaterIE,
|
||||||
)
|
)
|
||||||
from .zapiks import ZapiksIE
|
from .zapiks import ZapiksIE
|
||||||
|
from .zaq1 import Zaq1IE
|
||||||
from .zattoo import (
|
from .zattoo import (
|
||||||
BBVTVIE,
|
BBVTVIE,
|
||||||
EinsUndEinsTVIE,
|
EinsUndEinsTVIE,
|
||||||
|
@ -57,7 +57,6 @@ class NFLBaseIE(InfoExtractor):
|
|||||||
)/
|
)/
|
||||||
'''
|
'''
|
||||||
_VIDEO_CONFIG_REGEX = r'<script[^>]+id="[^"]*video-config-[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}[^"]*"[^>]*>\s*({.+})'
|
_VIDEO_CONFIG_REGEX = r'<script[^>]+id="[^"]*video-config-[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}[^"]*"[^>]*>\s*({.+})'
|
||||||
_WORKING = False
|
|
||||||
|
|
||||||
def _parse_video_config(self, video_config, display_id):
|
def _parse_video_config(self, video_config, display_id):
|
||||||
video_config = self._parse_json(video_config, display_id)
|
video_config = self._parse_json(video_config, display_id)
|
||||||
|
101
youtube_dl/extractor/zaq1.py
Normal file
101
youtube_dl/extractor/zaq1.py
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from .common import InfoExtractor
|
||||||
|
from ..utils import (
|
||||||
|
int_or_none,
|
||||||
|
unified_timestamp,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class Zaq1IE(InfoExtractor):
|
||||||
|
_VALID_URL = r'https?://(?:www\.)?zaq1\.pl/video/(?P<id>[^/?#&]+)'
|
||||||
|
_TESTS = [{
|
||||||
|
'url': 'http://zaq1.pl/video/xev0e',
|
||||||
|
'md5': '24a5eb3f052e604ae597c4d0d19b351e',
|
||||||
|
'info_dict': {
|
||||||
|
'id': 'xev0e',
|
||||||
|
'title': 'DJ NA WESELE. TANIEC Z FIGURAMI.węgrów/sokołów podlaski/siedlce/mińsk mazowiecki/warszawa',
|
||||||
|
'description': 'www.facebook.com/weseledjKontakt: 728 448 199 / 505 419 147',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'duration': 511,
|
||||||
|
'timestamp': 1490896361,
|
||||||
|
'uploader': 'Anonim',
|
||||||
|
'upload_date': '20170330',
|
||||||
|
'view_count': int,
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
# malformed JSON-LD
|
||||||
|
'url': 'http://zaq1.pl/video/x81vn',
|
||||||
|
'info_dict': {
|
||||||
|
'id': 'x81vn',
|
||||||
|
'title': 'SEKRETNE ŻYCIE WALTERA MITTY',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'duration': 6234,
|
||||||
|
'timestamp': 1493494860,
|
||||||
|
'uploader': 'Anonim',
|
||||||
|
'upload_date': '20170429',
|
||||||
|
'view_count': int,
|
||||||
|
},
|
||||||
|
'params': {
|
||||||
|
'skip_download': True,
|
||||||
|
},
|
||||||
|
'expected_warnings': ['Failed to parse JSON'],
|
||||||
|
}]
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
video_id = self._match_id(url)
|
||||||
|
|
||||||
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
|
video_url = self._search_regex(
|
||||||
|
r'data-video-url=(["\'])(?P<url>(?:(?!\1).)+)\1', webpage,
|
||||||
|
'video url', group='url')
|
||||||
|
|
||||||
|
info = self._search_json_ld(webpage, video_id, fatal=False)
|
||||||
|
|
||||||
|
def extract_data(field, name, fatal=False):
|
||||||
|
return self._search_regex(
|
||||||
|
r'data-%s=(["\'])(?P<field>(?:(?!\1).)+)\1' % field,
|
||||||
|
webpage, field, fatal=fatal, group='field')
|
||||||
|
|
||||||
|
if not info.get('title'):
|
||||||
|
info['title'] = extract_data('file-name', 'title', fatal=True)
|
||||||
|
|
||||||
|
if not info.get('duration'):
|
||||||
|
info['duration'] = int_or_none(extract_data('duration', 'duration'))
|
||||||
|
|
||||||
|
if not info.get('thumbnail'):
|
||||||
|
info['thumbnail'] = extract_data('photo-url', 'thumbnail')
|
||||||
|
|
||||||
|
if not info.get('timestamp'):
|
||||||
|
info['timestamp'] = unified_timestamp(self._html_search_meta(
|
||||||
|
'uploadDate', webpage, 'timestamp'))
|
||||||
|
|
||||||
|
if not info.get('interactionCount'):
|
||||||
|
info['view_count'] = int_or_none(self._html_search_meta(
|
||||||
|
'interactionCount', webpage, 'view count'))
|
||||||
|
|
||||||
|
uploader = self._html_search_regex(
|
||||||
|
r'Wideo dodał:\s*<a[^>]*>([^<]+)</a>', webpage, 'uploader',
|
||||||
|
fatal=False)
|
||||||
|
|
||||||
|
width = int_or_none(self._html_search_meta(
|
||||||
|
'width', webpage, fatal=False))
|
||||||
|
height = int_or_none(self._html_search_meta(
|
||||||
|
'height', webpage, fatal=False))
|
||||||
|
|
||||||
|
info.update({
|
||||||
|
'id': video_id,
|
||||||
|
'formats': [{
|
||||||
|
'url': video_url,
|
||||||
|
'width': width,
|
||||||
|
'height': height,
|
||||||
|
'http_headers': {
|
||||||
|
'Referer': url,
|
||||||
|
},
|
||||||
|
}],
|
||||||
|
'uploader': uploader,
|
||||||
|
})
|
||||||
|
|
||||||
|
return info
|
Loading…
Reference in New Issue
Block a user