rebase servers
This commit is contained in:
Regular → Executable
+1
-1
@@ -13,7 +13,7 @@ def get_long_url(short_url):
|
||||
data = httptools.downloadpage(short_url).data
|
||||
ysmm = scrapertools.find_single_match(data, "var ysmm = '([^']+)';")
|
||||
b64 = ""
|
||||
for i in reversed(range(len(ysmm))):
|
||||
for i in reversed(list(range(len(ysmm)))):
|
||||
if i % 2:
|
||||
b64 = b64 + ysmm[i]
|
||||
else:
|
||||
|
||||
Regular → Executable
+10
-1
@@ -1,6 +1,15 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import urllib
|
||||
import sys
|
||||
PY3 = False
|
||||
if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int
|
||||
|
||||
if PY3:
|
||||
#from future import standard_library
|
||||
#standard_library.install_aliases()
|
||||
import urllib.parse as urllib # Es muy lento en PY2. En PY3 es nativo
|
||||
else:
|
||||
import urllib # Usamos el nativo de PY2 que es más rápido
|
||||
|
||||
from core import scrapertools
|
||||
from platformcode import logger
|
||||
|
||||
Regular → Executable
+12
-2
@@ -1,7 +1,17 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
PY3 = False
|
||||
if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int
|
||||
|
||||
if PY3:
|
||||
#from future import standard_library
|
||||
#standard_library.install_aliases()
|
||||
import urllib.parse as urllib # Es muy lento en PY2. En PY3 es nativo
|
||||
else:
|
||||
import urllib # Usamos el nativo de PY2 que es más rápido
|
||||
|
||||
import re
|
||||
import urllib
|
||||
|
||||
from core import httptools
|
||||
from core import scrapertools
|
||||
@@ -41,5 +51,5 @@ def get_long_urls(data):
|
||||
long_url = scrapertools.scrapertools.find_single_match(longurl_data, '<long-url><!\[CDATA\[(.*?)\]\]></long-url>')
|
||||
except:
|
||||
long_url = ""
|
||||
if (long_url <> ""): data = data.replace(short_url, long_url)
|
||||
if (long_url != ""): data = data.replace(short_url, long_url)
|
||||
return data
|
||||
|
||||
Reference in New Issue
Block a user