mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-18 00:05:46 +00:00
[Epidemic Sound] Cleanup code
This commit is contained in:
parent
09496419ad
commit
d8c1711090
1 changed files with 10 additions and 14 deletions
|
@ -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…
Reference in a new issue