Compare commits

..

4 Commits

Author SHA1 Message Date
Dr. Steven Strange
effa2ea391 [AcademyMelIE]&[GetCourseRuIE] test the playlist 2024-01-14 23:34:06 +01:00
bashonly
8a54a769a7
[ie/getcourseru] More lenient _VALID_URL 2024-01-14 22:07:16 +00:00
bashonly
965935fc32
[ie/getcourseru] Cleanup 2024-01-14 22:00:07 +00:00
bashonly
72f9a57674
[ie/academymel] Cleanup 2024-01-14 21:57:37 +00:00
2 changed files with 16 additions and 18 deletions

View File

@ -3,25 +3,28 @@ import time
from .common import InfoExtractor from .common import InfoExtractor
from .getcourseru import GetCourseRuIE from .getcourseru import GetCourseRuIE
from ..utils import urlencode_postdata, update_url_query from ..utils import update_url_query, urlencode_postdata
class AcademyMelIE(InfoExtractor): class AcademyMelIE(InfoExtractor):
_TEST_EMAIL = 'meriat@jaga.email' # use this as username in the test/local_parameters.json if running the test
_TEST_PASSWORD = 'bBY-ccbp$8' # use this as password in the test/local_parameters.json if running the test
_LOGIN_URL = 'https://academymel.online/cms/system/login'
_NETRC_MACHINE = 'academymel' _NETRC_MACHINE = 'academymel'
_VALID_URL = r'https?://academymel\.online/(?P<id>[^/?#]+)' _VALID_URL = r'https?://academymel\.online/(?P<id>[^/?#]+)'
_LOGIN_URL = 'https://academymel.online/cms/system/login'
_TESTS = [{ _TESTS = [{
'url': 'http://academymel.online/3video_1', 'url': 'http://academymel.online/3video_1',
'info_dict': { 'info_dict': {
'id': '4885302', 'id': '3video_1',
'title': 'Промоуроки Академии МЕЛ', 'title': 'Промоуроки Академии МЕЛ',
'ext': 'mp4', },
'duration': 1693 'playlist_count': 1,
} 'playlist': [{
'info_dict': {
'id': '4885302',
'ext': 'mp4',
'title': 'Промоуроки Академии МЕЛ',
'duration': 1693
},
}]
}] }]
def _perform_login(self, username, password): def _perform_login(self, username, password):

View File

@ -3,25 +3,20 @@ from ..utils import int_or_none, traverse_obj, url_or_none
class GetCourseRuIE(InfoExtractor): class GetCourseRuIE(InfoExtractor):
_NETRC_MACHINE = 'getcourseru' _VALID_URL = r'https?://[^.]+\.getcourse\.ru/sign-player/?\?(?:[^#]+&)?json=(?P<id>[^#&]+)'
_VALID_URL = r'https?://[^.]+\.getcourse\.ru/sign-player/\?json=(?P<id>[^#]+)'
_TESTS = [{ _TESTS = [{
'url': 'http://player02.getcourse.ru/sign-player/?json=eyJ2aWRlb19oYXNoIjoiMTkwYmRmOTNmMWIyOTczNTMwOTg1M2E3YTE5ZTI0YjMiLCJ1c2VyX2lkIjozNTk1MjUxODMsInN1Yl9sb2dpbl91c2VyX2lkIjpudWxsLCJsZXNzb25faWQiOm51bGwsImlwIjoiNDYuMTQyLjE4Mi4yNDciLCJnY19ob3N0IjoiYWNhZGVteW1lbC5vbmxpbmUiLCJ0aW1lIjoxNzA1MjY2Njc2LCJwYXlsb2FkIjoidV8zNTk1MjUxODMiLCJ1aV9sYW5ndWFnZSI6InJ1IiwiaXNfaGF2ZV9jdXN0b21fc3R5bGUiOnRydWV9&s=0c5e0c6aef19da36add3135a162b8eba&vh-static-feature=zigzag', 'url': 'http://player02.getcourse.ru/sign-player/?json=eyJ2aWRlb19oYXNoIjoiMTkwYmRmOTNmMWIyOTczNTMwOTg1M2E3YTE5ZTI0YjMiLCJ1c2VyX2lkIjozNTk1MjUxODMsInN1Yl9sb2dpbl91c2VyX2lkIjpudWxsLCJsZXNzb25faWQiOm51bGwsImlwIjoiNDYuMTQyLjE4Mi4yNDciLCJnY19ob3N0IjoiYWNhZGVteW1lbC5vbmxpbmUiLCJ0aW1lIjoxNzA1MjcwMzU0LCJwYXlsb2FkIjoidV8zNTk1MjUxODMiLCJ1aV9sYW5ndWFnZSI6InJ1IiwiaXNfaGF2ZV9jdXN0b21fc3R5bGUiOnRydWV9&s=031d44cc738c58863a436d98f1032132&vh-static-feature=zigzag',
'info_dict': { 'info_dict': {
'id': '4885302', 'id': '4885302',
'title': '190bdf93f1b29735309853a7a19e24b3', 'title': '190bdf93f1b29735309853a7a19e24b3',
'ext': 'mp4', 'ext': 'mp4',
'duration': 1693 'duration': 1693
# note: the original URL is necessary to obtain an up-to-date URL, because the URL is always changing
}, },
'skip': 'Requires authentication', 'skip': 'JWT expired',
'note': 'This extractor is used by AcademyMel extractor, which has a login feature'
}] }]
def _real_extract(self, url): def _real_extract(self, url):
webpage = self._download_webpage(url, None, 'Downloading player page') webpage = self._download_webpage(url, None, 'Downloading player page')
window_configs = self._search_json( window_configs = self._search_json(
r'window\.configs\s*=', webpage, 'config', None) r'window\.configs\s*=', webpage, 'config', None)
video_id = str(window_configs['videoId']) video_id = str(window_configs['videoId'])