Added 1channel external URL resolver

develop
Sven Slootweg 13 years ago
parent ea328b2201
commit 65b77ccf8e

@ -6,5 +6,7 @@ def resolve(url):
return putlocker.resolve(url)
elif re.match("https?:\/\/(www\.)?sockshare\.com", url) is not None:
return sockshare.resolve(url)
elif re.match("https?:\/\/(www\.)?1channel\.ch\/external\.php", url) is not None:
return onechannel.resolve(url)
else:
return {}

@ -1,3 +1,4 @@
from dummy import *
from putlocker import *
from sockshare import *
from onechannel import *

@ -0,0 +1,15 @@
import re, base64
from resolv.shared import ResolverError
def resolve(url):
matches = re.search("https?:\/\/(www\.)?1channel\.ch\/external\.php\?.*url=([^&]+)", url)
if matches is None:
raise ResolverError("The provided URL is not a valid external 1channel URL.")
try:
real_url = base64.b64decode(matches.group(2)).strip()
except TypeError:
raise ResolverError("The provided URL is malformed.")
return { 'url': real_url }
Loading…
Cancel
Save