urllib was meant for yourls.py not shorturl.py
This commit is contained in:
parent
042688ce77
commit
0cdd3d5b6c
2 changed files with 3 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
||||||
#--depends-on commands
|
#--depends-on commands
|
||||||
#--depends-on config
|
#--depends-on config
|
||||||
|
|
||||||
import re, urllib
|
import re
|
||||||
from src import ModuleManager, utils
|
from src import ModuleManager, utils
|
||||||
|
|
||||||
URL_BITLYSHORTEN = "https://api-ssl.bitly.com/v3/shorten"
|
URL_BITLYSHORTEN = "https://api-ssl.bitly.com/v3/shorten"
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
|
import urllib.parse
|
||||||
from src import ModuleManager, utils
|
from src import ModuleManager, utils
|
||||||
|
|
||||||
def _parse(s):
|
def _parse(s):
|
||||||
parsed = urllib.parse.urlpare(s)
|
parsed = urllib.parse.urlparse(s)
|
||||||
return urllib.parse.urljoin(s, parsed.path), parsed.query
|
return urllib.parse.urljoin(s, parsed.path), parsed.query
|
||||||
|
|
||||||
SETTING = utils.FunctionSetting(_parse, "yourls",
|
SETTING = utils.FunctionSetting(_parse, "yourls",
|
||||||
|
|
Loading…
Reference in a new issue