From bce9e2bc80d200d18b1f27dbeef2859d667347c0 Mon Sep 17 00:00:00 2001 From: Abhishek Thakur Date: Wed, 28 Sep 2022 20:28:09 +0530 Subject: [PATCH] Completed ErocastIE --- youtube_dl/extractor/erocast.py | 113 +++++--------------------------- 1 file changed, 16 insertions(+), 97 deletions(-) diff --git a/youtube_dl/extractor/erocast.py b/youtube_dl/extractor/erocast.py index 649d8920d..6dc0ee4e8 100644 --- a/youtube_dl/extractor/erocast.py +++ b/youtube_dl/extractor/erocast.py @@ -8,101 +8,14 @@ class ErocastIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?erocast\.me/track/(?P[0-9]+)/([a-z]+-)+[a-z]+' _TEST = { 'url': 'https://erocast.me/track/4254/intimate-morning-with-your-wife', - 'md5': 'TODO: md5 sum of the first 10241 bytes of the video file (use --test)', 'info_dict': { - 'id': 4254, + 'id': '4254', 'ext': 'mp3', 'mp3': 0, - 'waveform': 0, - 'preview': 0, - 'wav': 0, - 'flac': 0, - 'hd': 0, - 'hls': 1, - 'explicit': 0, - 'selling': 1, - 'price': '0.00', - 'genre': '10,6', - 'mood': None, - 'title': 'Intimate morning with your wife', - 'description': None, - 'access': None, - 'duration': 1409, - 'artistIds': None, - 'loves': 0, - 'collectors': 0, - 'plays': 2344, - 'released_at': '08/26/2022', - 'copyright': None, - 'allow_download': 0, - 'download_count': 0, - 'allow_comments': 1, - 'comment_count': 0, - 'visibility': 1, - 'approved': 1, - 'pending': 0, - 'created_at': '2022-08-26T19:20:14.000000Z', - 'updated_at': '2022-08-27T11:49:34.000000Z', - 'vocal': 1, - 'script': None, - 'artwork_url': 'https://erocast.me/common/default/song.png', - 'permalink_url': 'https://erocast.me/track/4254/intimate-morning-with-your-wife', - 'stream_url': 'https://erocast.me/stream/hls/4254', - 'favorite': False, - 'library': False, - 'streamable': True, - 'user': { - 'id': 4198, - 'name': 'ZLOY_ASMR', - 'username': 'ZLOY_ASMR', - 'session_id': None, - 'artist_id': 0, - 'collection_count': 0, - 'following_count': 0, - 'follower_count': 0, - 'last_activity': '2022-08-26 19:41:03', - 'notification': None, - 'bio': None, - 'allow_comments': 1, - 'comment_count': 0, - 'script': None, - 'artwork_url': 'https://erocast.me/common/default/user.png', - 'permalink_url': 'https://erocast.me/zloy-asmr' - }, - 'tags': [ - { - 'id': 48044, - 'song_id': 4254, - 'tag': 'morning', - 'permalink_url': 'https://erocast.me/tracks/tag/morning' - }, - { - 'id': 48045, - 'song_id': 4254, - 'tag': 'established relationships', - 'permalink_url': 'https://erocast.me/tracks/tag/established-relationships' - }, - { - 'id': 48046, - 'song_id': 4254, - 'tag': 'wholesome', - 'permalink_url': 'https://erocast.me/tracks/tag/wholesome' - }, - { - 'id': 48047, - 'song_id': 4254, - 'tag': 'kisses', - 'permalink_url': 'https://erocast.me/tracks/tag/kisses' - }, - { - 'id': 48048, - 'song_id': 4254, - 'tag': 'wife', - 'permalink_url': 'https://erocast.me/tracks/tag/wife' - } - ] + 'title':'Intimate morning with your wife' # TODO more properties, either as: - # * A value + # * A + # value # * MD5 checksum; start the string with md5: # * A regular expression; start the string with re: # * Any Python type (for example int or float) @@ -112,14 +25,20 @@ class ErocastIE(InfoExtractor): def _real_extract(self, url): video_id = self._match_id(url) webpage = self._download_webpage(url, video_id) - + json_data = self._search_regex(r'", "") + json_data = json_data[json_data.find('{') - 1:] + json_data = self._parse_json(json_data, video_id) + ext="mp3" # TODO more code goes here, for example ... - title = self._html_search_regex(r'

(.+?)

', webpage, 'title') - + # title = self._html_search_regex(r'