[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.
pull/726/head
Mike Fährmann 4 years ago
parent a31c1aae72
commit 08674a91f3
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -1,5 +1,7 @@
# Changelog # Changelog
## Unreleased
## 1.13.4 - 2020-04-12 ## 1.13.4 - 2020-04-12
### Additions ### 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)) - [aryion] add `gallery` and `post` extractors ([#390](https://github.com/mikf/gallery-dl/issues/390), [#673](https://github.com/mikf/gallery-dl/issues/673))

@ -47,7 +47,7 @@ class PatreonExtractor(Extractor):
self._attachments(post), self._attachments(post),
self._content(post), self._content(post),
): ):
fhash = url.rsplit("/", 2)[1] fhash = url.split("/")[9].partition("?")[0]
if fhash not in hashes: if fhash not in hashes:
hashes.add(fhash) hashes.add(fhash)
post["hash"] = fhash post["hash"] = fhash

@ -6,4 +6,4 @@
# it under the terms of the GNU General Public License version 2 as # it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation. # published by the Free Software Foundation.
__version__ = "1.13.4" __version__ = "1.13.5-dev"

Loading…
Cancel
Save