Skip to content

Commit

Permalink
added support for coomer.party
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphaSlayer1964 committed Dec 13, 2021
1 parent e2e91eb commit 92c236b
Show file tree
Hide file tree
Showing 4 changed files with 422 additions and 20 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ run.bat
kemono-dl.py.backup
kemono-dl_html.py.backup
broken_hashes.log
coomer.party_cookies.txt
50 changes: 42 additions & 8 deletions src/arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,27 @@ def get_args():
metavar="FILE", type=str, default=[],
help="File containing URLs to download, one URL per line.")

ap.add_argument("--favorite-users",
# ap.add_argument("--favorite-users",
# action='store_true', default=False,
# help="Downloads all favorite users. (Requires cookies while logged in)")

# ap.add_argument("--favorite-posts",
# action='store_true', default=False,
# help="Downloads all favorites posts. (Requires cookies while logged in)")

ap.add_argument("--kemono-favorite-users",
action='store_true', default=False,
help="Downloads all favorite users. (Requires cookies while logged in)")

ap.add_argument("--kemono-favorite-posts",
action='store_true', default=False,
help="Downloads all favorites posts. (Requires cookies while logged in)")

ap.add_argument("--coomer-favorite-users",
action='store_true', default=False,
help="Downloads all favorite users. (Requires cookies while logged in)")

ap.add_argument("--favorite-posts",
ap.add_argument("--coomer-favorite-posts",
action='store_true', default=False,
help="Downloads all favorites posts. (Requires cookies while logged in)")

Expand Down Expand Up @@ -148,13 +164,31 @@ def get_args():
print('[Error] Only use one: --archive or --update')
quit()

# if args['cookies']:
# try:
# args['cookies'] = MozillaCookieJar(args['cookies'])
# args['cookies'].load()
# except (LoadError, FileNotFoundError) as e:
# print(e)
# quit()

if args['cookies']:
try:
args['cookies'] = MozillaCookieJar(args['cookies'])
args['cookies'].load()
except (LoadError, FileNotFoundError) as e:
print(e)
quit()
cookie_files = args['cookies'].split(',')
if len(cookie_files) == 1:
try:
args['cookies'] = MozillaCookieJar(args['cookies'])
args['cookies'].load()
except (LoadError, FileNotFoundError) as e:
print(e)
quit()
elif len(cookie_files) == 2:
try:
args['cookies'] = MozillaCookieJar()
args['cookies'].load(cookie_files[0])
args['cookies'].load(cookie_files[1])
except (LoadError, FileNotFoundError) as e:
print(e)
quit()

if args['output']:
if not os.path.exists(args['output']):
Expand Down
Loading

0 comments on commit 92c236b

Please sign in to comment.