File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ ```
Original file line number Diff line number Diff 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 ''
You can’t perform that action at this time.
0 commit comments