Skip to content

Commit 8dce25a

Browse files
committed
Update README
1 parent 40ff611 commit 8dce25a

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
11
# python
22

3-
个人用Python脚本
3+
Some small Python utilities
4+
5+
## `fantia.py`
6+
7+
Fantia downloader. Inspired by [dumpia](https://github.com/itskenny0/dumpia).
8+
9+
Usage:
10+
11+
```python
12+
from fantia import FantiaDownloader
13+
14+
key = 'your _session_id' # copy it from cookie `_session_id` on fantia.jp
15+
id = 1111111111111111111
16+
downloader = FantiaDownloader(fanclub=id, output=".", key=key)
17+
downloader.downloadAll()
18+
```

fantia.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def getWebName(url):
7373
for idx, p in enumerate(photos, 1):
7474
img_url = p['url']['original']
7575
stem, ext = getWebName(img_url)
76+
# Clean up the filename; remove all the UUID-ish garbage
7677
stem = re.sub(r'^[0-9a-fA-F]{8}_(.+)$', r'\1', stem)
7778
stem = re.sub(r'[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}', '', stem)
7879
idx_string = '_' + str(idx).zfill(len(str(len(photos)))) if len(photos) > 1 else ''

0 commit comments

Comments
 (0)