[Epidemic Sound] Cleanup code

pull/32628/head
realRobotix 6 months ago
parent 09496419ad
commit d8c1711090
No known key found for this signature in database
GPG Key ID: 7F4C32C9D72DAF0F

@ -2,7 +2,7 @@
from __future__ import unicode_literals
from .common import InfoExtractor
from datetime import datetime
from ..utils import unified_timestamp
class EpidemicSoundIE(InfoExtractor):
@ -17,25 +17,21 @@ class EpidemicSoundIE(InfoExtractor):
'title': 'Door Knock Door 1',
'duration': 1,
'thumbnail': 'https://cdn.epidemicsound.com/curation-assets/commercial-release-cover-images/default-sfx/3000x3000.jpg',
'timestamp': 1415320353,
'upload_date': '20141107',
}
}
def _real_extract(self, url):
video_id = self._match_id(url)
json_data = self._download_json('https://www.epidemicsound.com/json/track/' + video_id, video_id)
title = json_data.get('title')
image_url = json_data.get('imageUrl')
media_url = json_data.get('stems').get('full').get('lqMp3Url')
media_len = json_data.get('length')
timestamp = int(datetime.strptime(json_data.get('added'), '%Y-%m-%dT%H:%M:%S').timestamp())
tags = json_data.get('metadataTags')
return {
'id': video_id,
'url': media_url,
'tags': tags,
'title': title,
'duration': media_len,
'timestamp': timestamp,
'thumbnail': image_url,
}
'url': json_data.get('stems').get('full').get('lqMp3Url'),
'tags': json_data.get('metadataTags'),
'title': json_data.get('title'),
'duration': json_data.get('length'),
'timestamp': unified_timestamp(json_data.get('added')),
'thumbnail': json_data.get('imageUrl'),
}

Loading…
Cancel
Save