urllib was meant for yourls.py not shorturl.py

This commit is contained in:
jesopo 2020-03-08 23:58:24 +00:00
parent 042688ce77
commit 0cdd3d5b6c
2 changed files with 3 additions and 2 deletions

View file

@ -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"

View file

@ -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",