Add metadata and HTTP methods

master
Sven Slootweg 12 years ago
parent a8186e46ed
commit d6dd91cd85

@ -3,6 +3,10 @@ from resolv.shared import Task
class DummyTask(Task): class DummyTask(Task):
result_type = "dummy" result_type = "dummy"
name = "Dummy Resolver"
author = "Sven Slootweg"
author_url = "http://cryto.net/~joepie91"
def run(self): def run(self):
self.results = {'dummy': self.url} self.results = {'dummy': self.url}
self.state = "finished" self.state = "finished"

@ -4,6 +4,10 @@ from resolv.shared import ResolverError, Task
class FileboxTask(Task): class FileboxTask(Task):
result_type = "video" result_type = "video"
name = "Filebox.com"
author = "Sven Slootweg"
author_url = "http://cryto.net/~joepie91"
def run(self): def run(self):
matches = re.search("https?:\/\/(www\.)?filebox\.com\/([a-zA-Z0-9]+)", self.url) matches = re.search("https?:\/\/(www\.)?filebox\.com\/([a-zA-Z0-9]+)", self.url)
@ -29,6 +33,7 @@ class FileboxTask(Task):
stream_dict = { stream_dict = {
'url' : video_file, 'url' : video_file,
'method' : "GET",
'quality' : "unknown", 'quality' : "unknown",
'priority' : 1, 'priority' : 1,
'format' : "unknown" 'format' : "unknown"

@ -4,6 +4,10 @@ from resolv.shared import ResolverError, unescape, Task
class MediafireTask(Task): class MediafireTask(Task):
result_type = "file" result_type = "file"
name = "MediaFire"
author = "Sven Slootweg"
author_url = "http://cryto.net/~joepie91"
def run(self): def run(self):
try: try:
contents = self.fetch_page(self.url) contents = self.fetch_page(self.url)
@ -45,6 +49,7 @@ class MediafireTask(Task):
file_dict = { file_dict = {
'url' : file_url, 'url' : file_url,
'method' : "GET",
'priority' : 1, 'priority' : 1,
'format' : "unknown" 'format' : "unknown"
} }

@ -4,6 +4,10 @@ from resolv.shared import ResolverError, Task
class OneChannelTask(Task): class OneChannelTask(Task):
result_type = "url" result_type = "url"
name = "1channel"
author = "Sven Slootweg"
author_url = "http://cryto.net/~joepie91"
def run(self): def run(self):
matches = re.search("https?:\/\/(www\.)?1channel\.ch\/external\.php\?.*url=([^&]+)", self.url) matches = re.search("https?:\/\/(www\.)?1channel\.ch\/external\.php\?.*url=([^&]+)", self.url)

@ -4,6 +4,10 @@ from resolv.shared import ResolverError, unescape, Task
class PastebinTask(Task): class PastebinTask(Task):
result_type = "text" result_type = "text"
name = "Pastebin"
author = "Sven Slootweg"
author_url = "http://cryto.net/~joepie91"
def run(self): def run(self):
matches = re.search("https?:\/\/(www\.)?pastebin\.com\/([a-zA-Z0-9]+)", self.url) matches = re.search("https?:\/\/(www\.)?pastebin\.com\/([a-zA-Z0-9]+)", self.url)
@ -29,6 +33,7 @@ class PastebinTask(Task):
resolved = { resolved = {
'url' : "http://pastebin.com/download.php?i=%s" % paste_id, 'url' : "http://pastebin.com/download.php?i=%s" % paste_id,
'method' : "GET",
'priority' : 1, 'priority' : 1,
'format' : "text" 'format' : "text"
} }

@ -4,6 +4,10 @@ from resolv.shared import ResolverError, unescape, Task
class PutlockerTask(Task): class PutlockerTask(Task):
result_type = "video" result_type = "video"
name = "PutLocker"
author = "Sven Slootweg"
author_url = "http://cryto.net/~joepie91"
def run(self): def run(self):
try: try:
import mechanize import mechanize
@ -64,6 +68,7 @@ class PutlockerTask(Task):
stream_dict = { stream_dict = {
'url' : video_file, 'url' : video_file,
'method' : "GET",
'quality' : "unknown", 'quality' : "unknown",
'priority' : 1, 'priority' : 1,
'format' : "unknown" 'format' : "unknown"

@ -4,6 +4,10 @@ from resolv.shared import ResolverError, unescape, Task
class SockshareTask(Task): class SockshareTask(Task):
result_type = "video" result_type = "video"
name = "SockShare"
author = "Sven Slootweg"
author_url = "http://cryto.net/~joepie91"
def run(self): def run(self):
try: try:
import mechanize import mechanize
@ -64,6 +68,7 @@ class SockshareTask(Task):
stream_dict = { stream_dict = {
'url' : video_file, 'url' : video_file,
'method' : "GET",
'quality' : "unknown", 'quality' : "unknown",
'priority' : 1, 'priority' : 1,
'format' : "unknown" 'format' : "unknown"

@ -4,6 +4,10 @@ from resolv.shared import ResolverError, unescape, Task
class YoutubeTask(Task): class YoutubeTask(Task):
result_type = "video" result_type = "video"
name = "YouTube"
author = "Sven Slootweg"
author_url = "http://cryto.net/~joepie91"
extra_headers = { extra_headers = {
'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',

Loading…
Cancel
Save