Skip to content

Commit cda4d98

Browse files
committed
Two lines changed in __get_json (the __in chunk path and the normal path). Both now check if ? is already in the URL and use & instead
1 parent fe771c1 commit cda4d98

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

ncm/ncm/ncm.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,8 @@ def __get_json(self, get_url, call_type, params=None):
275275
if params is not None:
276276
from urllib.parse import urlencode
277277
query_string = urlencode(params)
278-
url = f'{url}?{query_string}'
278+
separator = '&' if '?' in url else '?'
279+
url = f'{url}{separator}{query_string}'
279280
while url and (len(results) < limit):
280281
ncm = self.session.get(url)
281282
if not (200 <= ncm.status_code < 300):
@@ -292,7 +293,8 @@ def __get_json(self, get_url, call_type, params=None):
292293
if params is not None:
293294
from urllib.parse import urlencode
294295
query_string = urlencode(params)
295-
url = f'{url}?{query_string}'
296+
separator = '&' if '?' in url else '?'
297+
url = f'{url}{separator}{query_string}'
296298
while url and (len(results) < limit):
297299
ncm = self.session.get(url)
298300
if not (200 <= ncm.status_code < 300):

0 commit comments

Comments
 (0)