From 08674a91f3442e5e56f7800643e938b7316ece59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Wed, 15 Apr 2020 23:28:57 +0200 Subject: [PATCH] [patreon] fix hash extraction from download URLs (closes #693) The old method was assuming every URL path ends with '/1'. For URLs where this is not the case, the segment containing the post ID was used as file hash. --- CHANGELOG.md | 2 ++ gallery_dl/extractor/patreon.py | 2 +- gallery_dl/version.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f54ac46c..da67c558 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog +## Unreleased + ## 1.13.4 - 2020-04-12 ### Additions - [aryion] add `gallery` and `post` extractors ([#390](https://github.com/mikf/gallery-dl/issues/390), [#673](https://github.com/mikf/gallery-dl/issues/673)) diff --git a/gallery_dl/extractor/patreon.py b/gallery_dl/extractor/patreon.py index 0d51df21..a44c8e70 100644 --- a/gallery_dl/extractor/patreon.py +++ b/gallery_dl/extractor/patreon.py @@ -47,7 +47,7 @@ class PatreonExtractor(Extractor): self._attachments(post), self._content(post), ): - fhash = url.rsplit("/", 2)[1] + fhash = url.split("/")[9].partition("?")[0] if fhash not in hashes: hashes.add(fhash) post["hash"] = fhash diff --git a/gallery_dl/version.py b/gallery_dl/version.py index 79055008..467a1bf7 100644 --- a/gallery_dl/version.py +++ b/gallery_dl/version.py @@ -6,4 +6,4 @@ # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. -__version__ = "1.13.4" +__version__ = "1.13.5-dev"