Compare commits

..

2 Commits

Author SHA1 Message Date
realRobotix
4a49a2f498
[Epidemic Sound] use index as id instead of slug 2023-12-05 23:29:32 +01:00
Robotix
f4b3f094ac
[EpidemicSound] formatting and documentation
Co-authored-by: dirkf <fieldhouse@gmx.net>
2023-12-05 22:42:44 +01:00

View File

@ -4,11 +4,11 @@ from __future__ import unicode_literals
from .common import InfoExtractor from .common import InfoExtractor
from ..utils import ( from ..utils import (
float_or_none, float_or_none,
T,
traverse_obj,
txt_or_none, txt_or_none,
unified_timestamp, unified_timestamp,
url_or_none, url_or_none,
traverse_obj,
T,
) )
@ -18,7 +18,8 @@ class EpidemicSoundIE(InfoExtractor):
'url': 'https://www.epidemicsound.com/track/yFfQVRpSPz/', 'url': 'https://www.epidemicsound.com/track/yFfQVRpSPz/',
'md5': 'd98ff2ddb49e8acab9716541cbc9dfac', 'md5': 'd98ff2ddb49e8acab9716541cbc9dfac',
'info_dict': { 'info_dict': {
'id': 'yFfQVRpSPz', 'id': '45014',
'display_id': 'yFfQVRpSPz',
'ext': 'mp3', 'ext': 'mp3',
'tags': ['foley', 'door', 'knock', 'glass', 'window', 'glass door knock'], 'tags': ['foley', 'door', 'knock', 'glass', 'window', 'glass door knock'],
'title': 'Door Knock Door 1', 'title': 'Door Knock Door 1',
@ -27,13 +28,16 @@ class EpidemicSoundIE(InfoExtractor):
'timestamp': 1415320353, 'timestamp': 1415320353,
'upload_date': '20141107', 'upload_date': '20141107',
'age_limit': None, 'age_limit': None,
# check that the "best" format was found, since test file MD5 doesn't
# distinguish the formats
'format': 'full', 'format': 'full',
}, },
}, { }, {
'url': 'https://www.epidemicsound.com/track/mj8GTTwsZd/', 'url': 'https://www.epidemicsound.com/track/mj8GTTwsZd/',
'md5': 'c82b745890f9baf18dc2f8d568ee3830', 'md5': 'c82b745890f9baf18dc2f8d568ee3830',
'info_dict': { 'info_dict': {
'id': 'mj8GTTwsZd', 'id': '148700',
'display_id': 'mj8GTTwsZd',
'ext': 'mp3', 'ext': 'mp3',
'tags': ['liquid drum n bass', 'energetic'], 'tags': ['liquid drum n bass', 'energetic'],
'title': 'Noplace', 'title': 'Noplace',
@ -74,6 +78,7 @@ class EpidemicSoundIE(InfoExtractor):
self._sort_formats(formats) self._sort_formats(formats)
info = traverse_obj(json_data, { info = traverse_obj(json_data, {
'id': ('id', T(txt_or_none)),
'tags': ('metadataTags', Ellipsis, T(txt_or_none)), 'tags': ('metadataTags', Ellipsis, T(txt_or_none)),
'title': ('title', T(txt_or_none)), 'title': ('title', T(txt_or_none)),
'duration': ('length', T(float_or_none)), 'duration': ('length', T(float_or_none)),
@ -89,7 +94,7 @@ class EpidemicSoundIE(InfoExtractor):
})) }))
info.update({ info.update({
'id': video_id, 'display_id': video_id,
'formats': formats, 'formats': formats,
}) })