mirror of
https://github.com/RicterZ/nhentai.git
synced 2025-04-19 18:31:24 +02:00
urlparse for python3
This commit is contained in:
parent
3ba8f62fe2
commit
148b4a1a08
@ -7,6 +7,7 @@ except ImportError:
|
||||
pass
|
||||
|
||||
import nhentai.constant as constant
|
||||
from nhentai.utils import urlparse
|
||||
from nhentai.logger import logger
|
||||
|
||||
|
||||
@ -64,8 +65,7 @@ def cmd_parser():
|
||||
exit(0)
|
||||
|
||||
if args.proxy:
|
||||
import urlparse
|
||||
proxy_url = urlparse.urlparse(args.proxy)
|
||||
proxy_url = urlparse(args.proxy)
|
||||
if proxy_url.scheme not in ('http', 'https'):
|
||||
logger.error('Invalid protocol \'{0}\' of proxy, ignored'.format(proxy_url.scheme))
|
||||
else:
|
||||
|
@ -1,12 +1,12 @@
|
||||
import os
|
||||
import urlparse
|
||||
from nhentai.utils import urlparse
|
||||
|
||||
BASE_URL = os.getenv('NHENTAI', 'https://nhentai.net')
|
||||
|
||||
DETAIL_URL = '%s/g' % BASE_URL
|
||||
SEARCH_URL = '%s/search/' % BASE_URL
|
||||
|
||||
u = urlparse.urlparse(BASE_URL)
|
||||
u = urlparse(BASE_URL)
|
||||
IMAGE_URL = '%s://i.%s/galleries' % (u.scheme, u.hostname)
|
||||
|
||||
PROXY = {}
|
||||
|
@ -11,4 +11,12 @@ class _Singleton(type):
|
||||
return cls._instances[cls]
|
||||
|
||||
|
||||
class Singleton(_Singleton('SingletonMeta', (object,), {})): pass
|
||||
class Singleton(_Singleton('SingletonMeta', (object,), {})):
|
||||
pass
|
||||
|
||||
|
||||
def urlparse(url):
|
||||
try:
|
||||
import urlparse
|
||||
except ImportError:
|
||||
import urllib.parse as urlparse
|
||||
|
Loading…
x
Reference in New Issue
Block a user