From 39054a04dfee61e6edba287ae2cd348c987e93a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Hautin?= <3902243+Mikaciu@users.noreply.github.com> Date: Mon, 27 Nov 2023 05:34:10 +0100 Subject: [PATCH] Update parsing logic for updated TPB proxy html structure (#3318) * fix: Update parsing logic for updated TPB proxy html structure --------- Co-authored-by: rembo10 --- CHANGELOG.md | 16 ++++++++++++++++ headphones/searcher.py | 4 +++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6002f623..79556c15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## v0.6.1 +Released 26 November 2023 + +Highlights: +* Dependency updates to work with > Python 3.11 + +The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.6.0...v0.6.1). + +## v0.6.0 +Released 13 November 2022 + +Highlights: +* Updated to python 3 + +The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.5.20...v0.6.0). + ## v0.5.20 Released 15 October 2021 diff --git a/headphones/searcher.py b/headphones/searcher.py index 4c5d31f7..93ec607a 100644 --- a/headphones/searcher.py +++ b/headphones/searcher.py @@ -1777,7 +1777,7 @@ def searchTorrent(album, new=False, losslessOnly=False, albumlength=None, # Pirate Bay if headphones.CONFIG.PIRATEBAY: provider = "The Pirate Bay" - tpb_term = term.replace("!", "").replace("'", " ") + tpb_term = term.replace("!", "").replace("'", " ").replace(" ", "%20") # Use proxy if specified if headphones.CONFIG.PIRATEBAY_PROXY_URL: @@ -1809,6 +1809,8 @@ def searchTorrent(album, new=False, losslessOnly=False, albumlength=None, # Process content if data: rows = data.select('table tbody tr') + if not rows: + rows = data.select('table tr') if not rows: logger.info("No results found from The Pirate Bay using term: %s" % tpb_term)