mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-15 21:53:21 +00:00
Compare commits
No commits in common. "1275aeb95559e22dc8b404e91d316b1fa6072804" and "63e66cd0ad2d96b53fdd77a40e19b46755c7219a" have entirely different histories.
1275aeb955
...
63e66cd0ad
@ -104,10 +104,6 @@ from .atttechchannel import ATTTechChannelIE
|
|||||||
from .atvat import ATVAtIE
|
from .atvat import ATVAtIE
|
||||||
from .audimedia import AudiMediaIE
|
from .audimedia import AudiMediaIE
|
||||||
from .audioboom import AudioBoomIE
|
from .audioboom import AudioBoomIE
|
||||||
from .audiodraft import (
|
|
||||||
AudiodraftCustomIE,
|
|
||||||
AudiodraftGenericIE,
|
|
||||||
)
|
|
||||||
from .audiomack import AudiomackIE, AudiomackAlbumIE
|
from .audiomack import AudiomackIE, AudiomackAlbumIE
|
||||||
from .audius import (
|
from .audius import (
|
||||||
AudiusIE,
|
AudiusIE,
|
||||||
|
@ -1,93 +0,0 @@
|
|||||||
from .common import InfoExtractor
|
|
||||||
from ..utils import int_or_none
|
|
||||||
|
|
||||||
|
|
||||||
class AudiodraftBaseIE(InfoExtractor):
|
|
||||||
def _audiodraft_extract_from_id(self, player_entry_id):
|
|
||||||
data_json = self._download_json(
|
|
||||||
'https://www.audiodraft.com/scripts/general/player/getPlayerInfoNew.php', player_entry_id,
|
|
||||||
headers={
|
|
||||||
'Content-type': 'application/x-www-form-urlencoded; charset=UTF-8',
|
|
||||||
'X-Requested-With': 'XMLHttpRequest',
|
|
||||||
}, data=f'id={player_entry_id}'.encode('utf-8'))
|
|
||||||
|
|
||||||
return {
|
|
||||||
'id': str(data_json['entry_id']),
|
|
||||||
'title': data_json.get('entry_title'),
|
|
||||||
'url': data_json['path'],
|
|
||||||
'vcodec': 'none',
|
|
||||||
'ext': 'mp3',
|
|
||||||
'uploader': data_json.get('designer_name'),
|
|
||||||
'uploader_id': data_json.get('designer_id'),
|
|
||||||
'webpage_url': data_json.get('entry_url'),
|
|
||||||
'like_count': int_or_none(data_json.get('entry_likes')),
|
|
||||||
'average_rating': int_or_none(data_json.get('entry_rating')),
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class AudiodraftCustomIE(AudiodraftBaseIE):
|
|
||||||
IE_NAME = 'Audiodraft:custom'
|
|
||||||
_VALID_URL = r'https?://(?:[-\w]+)\.audiodraft\.com/entry/(?P<id>\d+)'
|
|
||||||
|
|
||||||
_TESTS = [{
|
|
||||||
'url': 'http://nokiatune.audiodraft.com/entry/5874',
|
|
||||||
'info_dict': {
|
|
||||||
'id': '9485',
|
|
||||||
'ext': 'mp3',
|
|
||||||
'title': 'Hula Hula Calls',
|
|
||||||
'uploader': 'unclemaki',
|
|
||||||
'uploader_id': '13512',
|
|
||||||
'average_rating': 5,
|
|
||||||
'like_count': int,
|
|
||||||
},
|
|
||||||
}, {
|
|
||||||
'url': 'http://vikinggrace.audiodraft.com/entry/501',
|
|
||||||
'info_dict': {
|
|
||||||
'id': '22241',
|
|
||||||
'ext': 'mp3',
|
|
||||||
'title': 'MVG Happy',
|
|
||||||
'uploader': 'frog',
|
|
||||||
'uploader_id': '19142',
|
|
||||||
'average_rating': 5,
|
|
||||||
'like_count': int,
|
|
||||||
},
|
|
||||||
}, {
|
|
||||||
'url': 'http://timferriss.audiodraft.com/entry/765',
|
|
||||||
'info_dict': {
|
|
||||||
'id': '19710',
|
|
||||||
'ext': 'mp3',
|
|
||||||
'title': 'ferris03',
|
|
||||||
'uploader': 'malex',
|
|
||||||
'uploader_id': '17335',
|
|
||||||
'average_rating': 5,
|
|
||||||
'like_count': int,
|
|
||||||
},
|
|
||||||
}]
|
|
||||||
|
|
||||||
def _real_extract(self, url):
|
|
||||||
id = self._match_id(url)
|
|
||||||
webpage = self._download_webpage(url, id)
|
|
||||||
player_entry_id = self._search_regex(r'playAudio\(\'(player_entry_\d+)\'\);', webpage, id, 'play entry id')
|
|
||||||
return self._audiodraft_extract_from_id(player_entry_id)
|
|
||||||
|
|
||||||
|
|
||||||
class AudiodraftGenericIE(AudiodraftBaseIE):
|
|
||||||
IE_NAME = 'Audiodraft:generic'
|
|
||||||
_VALID_URL = r'https?://www\.audiodraft\.com/contests/[^/#]+#entries&eid=(?P<id>\d+)'
|
|
||||||
|
|
||||||
_TESTS = [{
|
|
||||||
'url': 'https://www.audiodraft.com/contests/570-Score-A-Video-Surprise-Us#entries&eid=30138',
|
|
||||||
'info_dict': {
|
|
||||||
'id': '30138',
|
|
||||||
'ext': 'mp3',
|
|
||||||
'title': 'DROP in sound_V2',
|
|
||||||
'uploader': 'TiagoSilva',
|
|
||||||
'uploader_id': '19452',
|
|
||||||
'average_rating': 4,
|
|
||||||
'like_count': int,
|
|
||||||
},
|
|
||||||
}]
|
|
||||||
|
|
||||||
def _real_extract(self, url):
|
|
||||||
id = self._match_id(url)
|
|
||||||
return self._audiodraft_extract_from_id(f'player_entry_{id}')
|
|
@ -28,7 +28,7 @@ class BigoIE(InfoExtractor):
|
|||||||
user_id = self._match_id(url)
|
user_id = self._match_id(url)
|
||||||
|
|
||||||
info_raw = self._download_json(
|
info_raw = self._download_json(
|
||||||
'https://ta.bigo.tv/official_website/studio/getInternalStudioInfo',
|
'https://bigo.tv/studio/getInternalStudioInfo',
|
||||||
user_id, data=urlencode_postdata({'siteId': user_id}))
|
user_id, data=urlencode_postdata({'siteId': user_id}))
|
||||||
|
|
||||||
if not isinstance(info_raw, dict):
|
if not isinstance(info_raw, dict):
|
||||||
@ -41,14 +41,14 @@ class BigoIE(InfoExtractor):
|
|||||||
if not info.get('alive'):
|
if not info.get('alive'):
|
||||||
raise ExtractorError('This user is offline.', expected=True)
|
raise ExtractorError('This user is offline.', expected=True)
|
||||||
|
|
||||||
formats, subs = self._extract_m3u8_formats_and_subtitles(
|
|
||||||
info.get('hls_src'), user_id, 'mp4', 'm3u8')
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': info.get('roomId') or user_id,
|
'id': info.get('roomId') or user_id,
|
||||||
'title': info.get('roomTopic') or info.get('nick_name') or user_id,
|
'title': info.get('roomTopic') or info.get('nick_name') or user_id,
|
||||||
'formats': formats,
|
'formats': [{
|
||||||
'subtitles': subs,
|
'url': info.get('hls_src'),
|
||||||
|
'ext': 'mp4',
|
||||||
|
'protocol': 'm3u8',
|
||||||
|
}],
|
||||||
'thumbnail': info.get('snapshot'),
|
'thumbnail': info.get('snapshot'),
|
||||||
'uploader': info.get('nick_name'),
|
'uploader': info.get('nick_name'),
|
||||||
'uploader_id': user_id,
|
'uploader_id': user_id,
|
||||||
|
@ -16,21 +16,21 @@ class FifaIE(InfoExtractor):
|
|||||||
'title': 'Italy v France | Final | 2006 FIFA World Cup Germany™ | Full Match Replay',
|
'title': 'Italy v France | Final | 2006 FIFA World Cup Germany™ | Full Match Replay',
|
||||||
'description': 'md5:f4520d0ee80529c8ba4134a7d692ff8b',
|
'description': 'md5:f4520d0ee80529c8ba4134a7d692ff8b',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'categories': ['FIFA Tournaments'],
|
'categories': ['FIFA Tournaments', 'Replay'],
|
||||||
'thumbnail': 'https://digitalhub.fifa.com/transform/fa6f0b3e-a2e9-4cf7-9f32-53c57bcb7360/2006_Final_ITA_FRA',
|
'thumbnail': 'https://digitalhub.fifa.com/transform/fa6f0b3e-a2e9-4cf7-9f32-53c57bcb7360/2006_Final_ITA_FRA',
|
||||||
'duration': 8165,
|
'duration': 8164,
|
||||||
},
|
},
|
||||||
'params': {'skip_download': 'm3u8'},
|
'params': {'skip_download': 'm3u8'},
|
||||||
}, {
|
}, {
|
||||||
'url': 'https://www.fifa.com/fifaplus/pt/watch/1cg5r5Qt6Qt12ilkDgb1sV',
|
'url': 'https://www.fifa.com/fifaplus/pt/watch/1cg5r5Qt6Qt12ilkDgb1sV',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '1cg5r5Qt6Qt12ilkDgb1sV',
|
'id': '1cg5r5Qt6Qt12ilkDgb1sV',
|
||||||
'title': 'Brazil v Germany | Semi-finals | 2014 FIFA World Cup Brazil™ | Extended Highlights',
|
'title': 'Brasil x Alemanha | Semifinais | Copa do Mundo FIFA Brasil 2014 | Compacto',
|
||||||
'description': 'md5:d908c74ee66322b804ae2e521b02a855',
|
'description': 'md5:ba4ffcc084802b062beffc3b4c4b19d6',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'categories': ['FIFA Tournaments', 'Highlights'],
|
'categories': ['FIFA Tournaments', 'Highlights'],
|
||||||
'thumbnail': 'https://digitalhub.fifa.com/transform/d8fe6f61-276d-4a73-a7fe-6878a35fd082/FIFAPLS_100EXTHL_2014BRAvGER_TMB',
|
'thumbnail': 'https://digitalhub.fifa.com/transform/d8fe6f61-276d-4a73-a7fe-6878a35fd082/FIFAPLS_100EXTHL_2014BRAvGER_TMB',
|
||||||
'duration': 902,
|
'duration': 901,
|
||||||
'release_timestamp': 1404777600,
|
'release_timestamp': 1404777600,
|
||||||
'release_date': '20140708',
|
'release_date': '20140708',
|
||||||
},
|
},
|
||||||
@ -39,8 +39,8 @@ class FifaIE(InfoExtractor):
|
|||||||
'url': 'https://www.fifa.com/fifaplus/fr/watch/3C6gQH9C2DLwzNx7BMRQdp',
|
'url': 'https://www.fifa.com/fifaplus/fr/watch/3C6gQH9C2DLwzNx7BMRQdp',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '3C6gQH9C2DLwzNx7BMRQdp',
|
'id': '3C6gQH9C2DLwzNx7BMRQdp',
|
||||||
'title': 'Josimar goal against Northern Ireland | Classic Goals',
|
'title': 'Le but de Josimar contre le Irlande du Nord | Buts classiques',
|
||||||
'description': 'md5:cbe7e7bb52f603c9f1fe9a4780fe983b',
|
'description': 'md5:16f9f789f09960bfe7220fe67af31f34',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'categories': ['FIFA Tournaments', 'Goal'],
|
'categories': ['FIFA Tournaments', 'Goal'],
|
||||||
'duration': 28,
|
'duration': 28,
|
||||||
@ -56,13 +56,27 @@ class FifaIE(InfoExtractor):
|
|||||||
preconnect_link = self._search_regex(
|
preconnect_link = self._search_regex(
|
||||||
r'<link[^>]+rel\s*=\s*"preconnect"[^>]+href\s*=\s*"([^"]+)"', webpage, 'Preconnect Link')
|
r'<link[^>]+rel\s*=\s*"preconnect"[^>]+href\s*=\s*"([^"]+)"', webpage, 'Preconnect Link')
|
||||||
|
|
||||||
|
json_data = self._download_json(
|
||||||
|
f'{preconnect_link}/video/GetVideoPlayerData/{video_id}', video_id,
|
||||||
|
'Downloading Video Player Data', query={'includeIdents': True, 'locale': locale})
|
||||||
|
|
||||||
video_details = self._download_json(
|
video_details = self._download_json(
|
||||||
f'{preconnect_link}/sections/videoDetails/{video_id}', video_id, 'Downloading Video Details', fatal=False)
|
f'{preconnect_link}/sections/videoDetails/{video_id}', video_id, 'Downloading Video Details', fatal=False)
|
||||||
|
|
||||||
preplay_parameters = self._download_json(
|
preplay_parameters = self._download_json(
|
||||||
f'{preconnect_link}/video/GetVerizonPreplayParameters/{video_id}', video_id, 'Downloading Preplay Parameters')['preplayParameters']
|
f'{preconnect_link}/video/GetVerizonPreplayParameters', video_id, 'Downloading Preplay Parameters', query={
|
||||||
|
'entryId': video_id,
|
||||||
|
'assetId': json_data['verizonAssetId'],
|
||||||
|
'useExternalId': False,
|
||||||
|
'requiresToken': json_data['requiresToken'],
|
||||||
|
'adConfig': 'fifaplusvideo',
|
||||||
|
'prerollAds': True,
|
||||||
|
'adVideoId': json_data['externalVerizonAssetId'],
|
||||||
|
'preIdentId': json_data['preIdentId'],
|
||||||
|
'postIdentId': json_data['postIdentId'],
|
||||||
|
})
|
||||||
|
|
||||||
cid = preplay_parameters['contentId']
|
cid = f'{json_data["preIdentId"]},{json_data["verizonAssetId"]},{json_data["postIdentId"]}'
|
||||||
content_data = self._download_json(
|
content_data = self._download_json(
|
||||||
f'https://content.uplynk.com/preplay/{cid}/multiple.json', video_id, 'Downloading Content Data', query={
|
f'https://content.uplynk.com/preplay/{cid}/multiple.json', video_id, 'Downloading Content Data', query={
|
||||||
'v': preplay_parameters['preplayAPIVersion'],
|
'v': preplay_parameters['preplayAPIVersion'],
|
||||||
@ -84,9 +98,9 @@ class FifaIE(InfoExtractor):
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'title': video_details.get('title'),
|
'title': json_data.get('title'),
|
||||||
'description': video_details.get('description'),
|
'description': json_data.get('description'),
|
||||||
'duration': int_or_none(video_details.get('duration')),
|
'duration': int_or_none(json_data.get('duration')),
|
||||||
'release_timestamp': unified_timestamp(video_details.get('dateOfRelease')),
|
'release_timestamp': unified_timestamp(video_details.get('dateOfRelease')),
|
||||||
'categories': traverse_obj(video_details, (('videoCategory', 'videoSubcategory'),)),
|
'categories': traverse_obj(video_details, (('videoCategory', 'videoSubcategory'),)),
|
||||||
'thumbnail': traverse_obj(video_details, ('backgroundImage', 'src')),
|
'thumbnail': traverse_obj(video_details, ('backgroundImage', 'src')),
|
||||||
|
Loading…
Reference in New Issue
Block a user