-
Notifications
You must be signed in to change notification settings - Fork 481
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixed EZTV plugin It requires a post parameter in order to get magnet links * Added retrieve_url function to eztv plugin so that it works for everybody * Try helpers.py's retrieve_url first, then fallback to urllib if it doesn't support POST * Attempt to satisfy linter * Reverted failed attempt at satisfying the linter * Appease linter, second attempt
- Loading branch information
Showing
2 changed files
with
24 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
#VERSION: 1.14 | ||
#VERSION: 1.15 | ||
# AUTHORS: nindogo | ||
# CONTRIBUTORS: Diego de las Heras ([email protected]) | ||
|
||
import urllib.error | ||
import urllib.parse | ||
import urllib.request | ||
from html.parser import HTMLParser | ||
|
||
from novaprinter import prettyPrinter | ||
|
@@ -10,7 +13,7 @@ | |
|
||
class eztv(object): | ||
name = "EZTV" | ||
url = 'https://eztv.re' | ||
url = 'https://eztvx.to/' | ||
supported_categories = {'all': 'all', 'tv': 'tv'} | ||
|
||
class MyHtmlParser(HTMLParser): | ||
|
@@ -59,9 +62,25 @@ def handle_endtag(self, tag): | |
prettyPrinter(self.current_item) | ||
self.in_table_row = False | ||
|
||
def do_query(self, what): | ||
url = f"{self.url}/search/{what.replace('%20', '-')}" | ||
data = b"layout=def_wlinks" | ||
try: | ||
return retrieve_url(url, request_data=data) | ||
except TypeError: | ||
# Older versions of retrieve_url did not support request_data/POST, se we must do the | ||
# request ourselves... | ||
user_agent = 'Mozilla/5.0 (X11; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0' | ||
req = urllib.request.Request(url, data, {'User-Agent': user_agent}) | ||
try: | ||
response = urllib.request.urlopen(req) # nosec B310 | ||
return response.read().decode('utf-8') | ||
except urllib.error.URLError as errno: | ||
print(f"Connection error: {errno.reason}") | ||
return "" | ||
|
||
def search(self, what, cat='all'): | ||
query = self.url + '/search/' + what.replace('%20', '-') | ||
eztv_html = retrieve_url(query) | ||
eztv_html = self.do_query(what) | ||
|
||
eztv_parser = self.MyHtmlParser(self.url) | ||
eztv_parser.feed(eztv_html) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
eztv: 1.14 | ||
eztv: 1.15 | ||
jackett: 4.0 | ||
limetorrents: 4.7 | ||
piratebay: 3.3 | ||
|