[fantia] add 'num' enumeration index (#2377)

* Adding numerical ordering to fantia

* Fixed line to fit PEP8 line size limit
This commit is contained in:
Orkun Koçyiğit
2022-03-09 00:06:41 +03:00
committed by GitHub
parent fac8047899
commit eb2bb7d998

View File

@@ -29,7 +29,9 @@ class FantiaExtractor(Extractor):
for post_id in self.posts():
full_response, post = self._get_post_data(post_id)
yield Message.Directory, post
post["num"] = 0
for url, url_data in self._get_urls_from_post(full_response, post):
post["num"] += 1
fname = url_data["content_filename"] or url
text.nameext_from_url(fname, url_data)
url_data["file_url"] = url