Skip to content

Commit

Permalink
release: v2.62.0
Browse files Browse the repository at this point in the history
  • Loading branch information
newt-sc committed Jun 17, 2021
1 parent 02e864c commit 2daf98c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* [v2.62.0](https://github.com/a4k-openproject/a4kScrapers/releases/tag/a4kScrapers-2.62.0):
* test fixes and handle head request exceptions

* [v2.61.0](https://github.com/a4k-openproject/a4kScrapers/releases/tag/a4kScrapers-2.61.0):
* add 7torrents
* exclude more keywords for movie titles
Expand Down
2 changes: 1 addition & 1 deletion meta.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"author": "Unknown",
"version":"2.61.0",
"version":"2.62.0",
"name":"a4kScrapers",
"update_directory": "https://github.com/a4k-openproject/a4kScrapers/archive/",
"remote_meta": "https://raw.githubusercontent.com/newt-sc/a4kScrapers/master/meta.json",
Expand Down
2 changes: 1 addition & 1 deletion providerModules/a4kScrapers/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ def _find_url(self):
if self._url is not None:
return self._url

if self.caller_name in ['showrss', 'skytorrents', 'bt4g', 'btscene', 'glodls', 'ext', 'torrentapi', 'torrentz2', 'scenerls', 'piratebay']:
if self.caller_name in ['showrss', 'skytorrents', 'bt4g', 'btscene', 'glo', 'extratorrents', 'torrentapi', 'torrentz2', 'scenerls', 'piratebay', 'magnetdl', '7torrents']:
self._request.skip_head = True

return self._request.find_url(self._urls)
Expand Down
19 changes: 13 additions & 6 deletions providerModules/a4kScrapers/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,20 @@ def _head(self, url):
tools.log('HEAD: %s' % url, 'debug')
request = lambda _: self._request.head(url, timeout=2)
request.url = url
response = self._request_core(request, sequental=False)
if _is_cloudflare_iuam_challenge(response, allow_empty_body=True):
response = lambda: None
response.url = url
response.status_code = 200

if response.status_code >= 400:
try:
response = self._request_core(request, sequental=False)
if _is_cloudflare_iuam_challenge(response, allow_empty_body=True):
response = lambda: None
response.url = url
response.status_code = 200

if response.status_code >= 400:
response = lambda: None
response.url = url
response.status_code = 200

except:
response = lambda: None
response.url = url
response.status_code = 200
Expand Down
2 changes: 1 addition & 1 deletion providerModules/a4kScrapers/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def _assert_result(test, scraper_module, scraper_sources, scraper, torrent_list)

test.assertEqual(results_count, expected_count, '%s failed to find torrent' % scraper)

if scraper == 'showrss' or scraper == 'extratorrent' or scraper == 'eztv':
if scraper == 'showrss' or scraper == 'extratorrent' or scraper == 'eztv' or scraper == 'torrentz2':
return

for torrent in torrent_list:
Expand Down

0 comments on commit 2daf98c

Please sign in to comment.