mirror of
https://github.com/instaloader/instaloader.git
synced 2024-09-11 16:22:24 +02:00
Fix downloading hashtags with unicode characters
Non-latin characters in the referer string used in the HTTP headers are now properly quoted.
This commit is contained in:
parent
9ee98a2925
commit
d967400cb4
@ -14,6 +14,7 @@ import string
|
|||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
import time
|
import time
|
||||||
|
import urllib.parse
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
from base64 import b64decode, b64encode
|
from base64 import b64decode, b64encode
|
||||||
from contextlib import contextmanager, suppress
|
from contextlib import contextmanager, suppress
|
||||||
@ -507,7 +508,7 @@ class Instaloader:
|
|||||||
tmpsession.headers['scheme'] = 'https'
|
tmpsession.headers['scheme'] = 'https'
|
||||||
tmpsession.headers['accept'] = '*/*'
|
tmpsession.headers['accept'] = '*/*'
|
||||||
if referer is not None:
|
if referer is not None:
|
||||||
tmpsession.headers['referer'] = referer
|
tmpsession.headers['referer'] = urllib.parse.quote(referer)
|
||||||
resp_json = self.get_json('graphql/query', params={'query_id': query_id,
|
resp_json = self.get_json('graphql/query', params={'query_id': query_id,
|
||||||
'variables': json.dumps(variables, separators=(',', ':'))},
|
'variables': json.dumps(variables, separators=(',', ':'))},
|
||||||
session=tmpsession)
|
session=tmpsession)
|
||||||
|
Loading…
Reference in New Issue
Block a user