HoloArchivists / twspace-dl

A python module to download twitter spaces.
GNU General Public License v2.0
473 stars 78 forks source link

"list index out of range" if the cookies.txt file don't contain "auth_token" record #36

Closed jim60105 closed 2 years ago

jim60105 commented 2 years ago

Describe the bug list index out of range if the cookies.txt file don't contain auth_token record

To Reproduce Pass an empty cookies.txt file in it.

Expected behavior I suggest making errors easier to read. Or outputting warnings and fallback to unlogined methods.

Output

Traceback (most recent call last):
  File "/venv/bin/twspace_dl", line 8, in <module>
    sys.exit(main())
  File "/venv/lib/python3.10/site-packages/twspace_dl/__main__.py", line 116, in main
    args.func(args)
  File "/venv/lib/python3.10/site-packages/twspace_dl/__main__.py", line 153, in twspace
    auth_token = load_from_file(args.input_cookie_file)
  File "/venv/lib/python3.10/site-packages/twspace_dl/login.py", line 9, in load_from_file
    return re.findall(
IndexError: list index out of range