diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d9461c..49d6fb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/meta.json b/meta.json index 40d5165..0c9a76f 100644 --- a/meta.json +++ b/meta.json @@ -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", diff --git a/providerModules/a4kScrapers/core.py b/providerModules/a4kScrapers/core.py index aed2e90..a33ad0b 100644 --- a/providerModules/a4kScrapers/core.py +++ b/providerModules/a4kScrapers/core.py @@ -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) diff --git a/providerModules/a4kScrapers/request.py b/providerModules/a4kScrapers/request.py index 30498bd..dc3272f 100644 --- a/providerModules/a4kScrapers/request.py +++ b/providerModules/a4kScrapers/request.py @@ -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 diff --git a/providerModules/a4kScrapers/test_utils.py b/providerModules/a4kScrapers/test_utils.py index c0c5bdf..3f3d8ec 100644 --- a/providerModules/a4kScrapers/test_utils.py +++ b/providerModules/a4kScrapers/test_utils.py @@ -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: