Actualizados
- allcalidad: Cambio de dominio - animeflv: Correción - streamcloud - Actualización interna
This commit is contained in:
@@ -3,15 +3,16 @@
|
||||
import re
|
||||
import urllib
|
||||
|
||||
from core import httptools
|
||||
from core import scrapertools
|
||||
from platformcode import logger
|
||||
|
||||
|
||||
def get_server_list():
|
||||
servers = []
|
||||
data = scrapertools.downloadpage("http://longurl.org/services")
|
||||
data = httptools.downloadpage("http://longurl.org/services").data
|
||||
data = scrapertools.unescape(data)
|
||||
data = scrapertools.get_match(data, '<ol>(.*?)</ol>')
|
||||
data = scrapertools.find_single_match(data, '<ol>(.*?)</ol>')
|
||||
patron = '<li>(.*?)</li>'
|
||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||
|
||||
@@ -33,11 +34,11 @@ def get_long_urls(data):
|
||||
for short_url in matches:
|
||||
if short_url.startswith(tuple(servers)):
|
||||
logger.info(": " + short_url)
|
||||
longurl_data = scrapertools.downloadpage(
|
||||
"http://api.longurl.org/v2/expand?url=" + urllib.quote_plus(short_url))
|
||||
longurl_data = httptools.downloadpage(
|
||||
"http://api.longurl.org/v2/expand?url=" + urllib.quote_plus(short_url)).data
|
||||
logger.info(longurl_data)
|
||||
try:
|
||||
long_url = scrapertools.get_match(longurl_data, '<long-url><!\[CDATA\[(.*?)\]\]></long-url>')
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user