master
Sven Slootweg 12 years ago
parent 88e6819bf2
commit 1d8332a776

@ -1,6 +1,8 @@
import re import re
import resolvers import resolvers
from resolv.shared import ResolverError
def resolve(url): def resolve(url):
if re.match("https?:\/\/(www\.)?putlocker\.com", url) is not None: if re.match("https?:\/\/(www\.)?putlocker\.com", url) is not None:
task = resolvers.PutlockerTask(url) task = resolvers.PutlockerTask(url)
@ -24,7 +26,7 @@ def resolve(url):
task = resolvers.MediafireTask(url) task = resolvers.MediafireTask(url)
return task.run() return task.run()
else: else:
return {} raise ResolverError("No suitable resolver found for %s" % url)
def recurse(url): def recurse(url):
previous_result = {} previous_result = {}
@ -32,7 +34,7 @@ def recurse(url):
while True: while True:
result = resolve(url) result = resolve(url)
if result.state != "finished": if result.state == "failed":
return previous_result return previous_result
elif result.result_type != "url": elif result.result_type != "url":
return result return result

Loading…
Cancel
Save