Skip to content

Commit 9562cd0

Browse files
committed
Make fc id optional
So you can still download post without it
1 parent cf43a7a commit 9562cd0

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ downloader = FantiaDownloader(fanclub=id, output=".", key=key)
2929
downloader.downloadAll()
3030
```
3131

32+
Or just download certain post (you can omit fanclub id in this case):
33+
34+
```python
35+
downloader = FantiaDownloader(output=".", key='your _session_id')
36+
downloader.getPostPhotos(12345)
37+
```
38+
3239
## `util.py`
3340

3441
Some utility functions mainly for myself. Read the code to get the idea. Some highlights:

scraper_fantia.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@
1212

1313
class FantiaDownloader:
1414

15-
def __init__(self, fanclub, output, key, skip_existing=True, quick_stop=True):
15+
def __init__(self, key, fanclub=None, output='.', skip_existing=True, quick_stop=True):
1616
super().__init__()
1717
self.key = key
1818
self.fanclub = fanclub
19+
if not self.fanclub:
20+
print('[W] no fanclub id is given. "downloadAll()" won\'t work.')
1921
self.output = Path(output)
2022
self.skip_existing = skip_existing
2123
self.quick_stop = skip_existing and quick_stop

0 commit comments

Comments
 (0)