mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-16 22:37:35 +00:00
Import from compat
This commit is contained in:
parent
3b31478dfd
commit
b4776f2e36
@ -1,13 +1,13 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import urllib.parse
|
|
||||||
from http.cookies import SimpleCookie
|
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..compat import (
|
from ..compat import (
|
||||||
compat_HTTPError,
|
compat_HTTPError,
|
||||||
compat_str,
|
compat_str,
|
||||||
|
compat_urllib_parse_unquote_plus,
|
||||||
|
compat_cookies_SimpleCookie,
|
||||||
)
|
)
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
determine_ext,
|
determine_ext,
|
||||||
@ -192,7 +192,7 @@ class NPOIE(NPOBaseIE):
|
|||||||
'Referer': url,
|
'Referer': url,
|
||||||
'X-Requested-With': 'XMLHttpRequest',
|
'X-Requested-With': 'XMLHttpRequest',
|
||||||
})
|
})
|
||||||
cookies = SimpleCookie()
|
cookies = compat_cookies_SimpleCookie()
|
||||||
cookies.load(xsrf_token_response.headers['Set-Cookie'])
|
cookies.load(xsrf_token_response.headers['Set-Cookie'])
|
||||||
cookies = {k: v.value for k, v in cookies.items()}
|
cookies = {k: v.value for k, v in cookies.items()}
|
||||||
xsrf_token = cookies['XSRF-TOKEN']
|
xsrf_token = cookies['XSRF-TOKEN']
|
||||||
@ -200,7 +200,7 @@ class NPOIE(NPOBaseIE):
|
|||||||
player = self._download_json(
|
player = self._download_json(
|
||||||
'https://www.npostart.nl/player/%s' % video_id, video_id,
|
'https://www.npostart.nl/player/%s' % video_id, video_id,
|
||||||
'Downloading player JSON',
|
'Downloading player JSON',
|
||||||
headers={"x-xsrf-token": urllib.parse.unquote(xsrf_token)},
|
headers={"x-xsrf-token": compat_urllib_parse_unquote_plus(xsrf_token)},
|
||||||
data=urlencode_postdata({
|
data=urlencode_postdata({
|
||||||
'autoplay': 0,
|
'autoplay': 0,
|
||||||
'share': 1,
|
'share': 1,
|
||||||
|
Loading…
Reference in New Issue
Block a user