Skip to content
Snippets Groups Projects
Unverified Commit 2dc1c0ba authored by Lesmiscore's avatar Lesmiscore
Browse files

Merge branch 'master' of https://github.com/yt-dlp/yt-dlp into ytdlp

* 'master' of https://github.com/yt-dlp/yt-dlp:
  [iwara] Add playlist extractors (#3639)
  [KhanAcademy] Fix extractor (#3462)
parents b1663dd5 ff4d7860
No related branches found
No related tags found
No related merge requests found
......@@ -714,9 +714,8 @@
from .ivideon import IvideonIE
from .iwara import (
IwaraIE,
IwaraUserIE,
IwaraUser2IE,
IwaraPlaylistIE,
IwaraUserIE,
)
from .izlesene import IzleseneIE
from .jable import (
......
import re
import itertools
import re
import urllib.parse
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse_urlparse,
)
from ..utils import (
int_or_none,
mimetype2ext,
......@@ -63,7 +61,7 @@ def _real_extract(self, url):
webpage, urlh = self._download_webpage_handle(url, video_id)
hostname = compat_urllib_parse_urlparse(urlh.geturl()).hostname
hostname = urllib.parse.urlparse(urlh.geturl()).hostname
# ecchi is 'sexy' in Japanese
age_limit = 18 if hostname.split('.')[0] == 'ecchi' else 0
......
......@@ -25,16 +25,21 @@ def _parse_video(self, video):
def _real_extract(self, url):
display_id = self._match_id(url)
component_props = self._parse_json(self._download_json(
'https://www.khanacademy.org/api/internal/graphql',
content = self._download_json(
'https://www.khanacademy.org/api/internal/graphql/FetchContentData',
display_id, query={
'hash': 1604303425,
'fastly_cacheable': 'persist_until_publish',
'hash': '4134764944',
'lang': 'en',
'variables': json.dumps({
'path': display_id,
'queryParams': '',
'queryParams': 'lang=en',
'isModal': False,
'followRedirects': True,
'countryCode': 'US',
}),
})['data']['contentJson'], display_id)['componentProps']
return self._parse_component_props(component_props)
})['data']['contentJson']
return self._parse_component_props(self._parse_json(content, display_id)['componentProps'])
class KhanAcademyIE(KhanAcademyBaseIE):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment