[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.
This commit is contained in:
Mike Fährmann
2020-04-15 23:28:57 +02:00
parent a31c1aae72
commit 08674a91f3
3 changed files with 4 additions and 2 deletions

View File

@@ -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