Battleman / zoomdl

Download Zoom recorded meetings easily
GNU General Public License v3.0
341 stars 44 forks source link

Getting `IndexError` in some executions of the program #60

Closed rodrigomorales1 closed 3 years ago

rodrigomorales1 commented 3 years ago

Prerequisite

Describe the bug

I'm getting IndexError in some executions of the program (see below).

Error.

$ ./zoomdl --cookies ~/Downloads/cookies.txt -u 'https://utec.zoom.us/rec/play/BqQCvFHnsW8S_uPtWzSZw2ce9vRVmZugEyt1NUv3lluYHp_bQicLYN3xuJLYVSwKwP_rdz_g3AOXgYvV.HprsohVuxRQ8oZxJ' 
Found 2 screens, downloading all of them
Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/myusername/Programs/zoomdl/./zoomdl/__main__.py", line 20, in <module>
  File "/home/myusername/Programs/zoomdl/./zoomdl/zoom_dl/__init__.py", line 18, in main
  File "/home/myusername/Programs/zoomdl/./zoomdl/zoom_dl/zoomdl.py", line 210, in download
  File "/home/myusername/Programs/zoomdl/./zoomdl/zoom_dl/zoomdl.py", line 115, in download_vid
IndexError: list index out of range

Again. Error.

$ ./zoomdl --cookies ~/Downloads/cookies.txt -u 'https://utec.zoom.us/rec/play/BqQCvFHnsW8S_uPtWzSZw2ce9vRVmZugEyt1NUv3lluYHp_bQicLYN3xuJLYVSwKwP_rdz_g3AOXgYvV.HprsohVuxRQ8oZxJ' 
Found 2 screens, downloading all of them
Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/myusername/Programs/zoomdl/./zoomdl/__main__.py", line 20, in <module>
  File "/home/myusername/Programs/zoomdl/./zoomdl/zoom_dl/__init__.py", line 18, in main
  File "/home/myusername/Programs/zoomdl/./zoomdl/zoom_dl/zoomdl.py", line 210, in download
  File "/home/myusername/Programs/zoomdl/./zoomdl/zoom_dl/zoomdl.py", line 115, in download_vid
IndexError: list index out of range

Again. Error.

$ ./zoomdl --cookies ~/Downloads/cookies.txt -u 'https://utec.zoom.us/rec/play/BqQCvFHnsW8S_uPtWzSZw2ce9vRVmZugEyt1NUv3lluYHp_bQicLYN3xuJLYVSwKwP_rdz_g3AOXgYvV.HprsohVuxRQ8oZxJ' 
Found 2 screens, downloading all of them
Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/myusername/Programs/zoomdl/./zoomdl/__main__.py", line 20, in <module>
  File "/home/myusername/Programs/zoomdl/./zoomdl/zoom_dl/__init__.py", line 18, in main
  File "/home/myusername/Programs/zoomdl/./zoomdl/zoom_dl/zoomdl.py", line 210, in download
  File "/home/myusername/Programs/zoomdl/./zoomdl/zoom_dl/zoomdl.py", line 115, in download_vid
IndexError: list index out of range

Whoops. It worked.

$ ./zoomdl --cookies ~/Downloads/cookies.txt -u 'https://utec.zoom.us/rec/play/BqQCvFHnsW8S_uPtWzSZw2ce9vRVmZugEyt1NUv3lluYHp_bQicLYN3xuJLYVSwKwP_rdz_g3AOXgYvV.HprsohVuxRQ8oZxJ' 
Found 2 screens, downloading all of them
File /home/myusername/Programs/zoomdl/Algoritmos_y_Estructura_de_datos_-_CS2100_-_TEORÍA_-_1_-_18_00_-_20_00screen0.mp4 already exists. This will erase it Continue? [y/N]:

To Reproduce

  1. Download the video I would download. I've posted the URL video in the URL section because I guess that this is because an unbad handling of a URL that is generated of the URL of the video being downloaded, so I hope that helps.

Expected behavior

The error is not generated, or handled and the user is informed.

Screenshots

URL (opt)

https://utec.zoom.us/rec/play/BqQCvFHnsW8S_uPtWzSZw2ce9vRVmZugEyt1NUv3lluYHp_bQicLYN3xuJLYVSwKwP_rdz_g3AOXgYvV.HprsohVuxRQ8oZxJ

Logs

The logs have already been provided in one of the first sections.

Versions

The version I'm currently using is (latest master branch as for the time of this writing)

$ git rev-parse HEAD
26d2da3f26e4ad81fef8bdef64fb1354339637ad
rodrigomorales1 commented 3 years ago

Here's more information that might be useful for solving this issue.

I tried executing the program again but added the following print statement in a line before the error is reported.

        for vid_num, vid_url in enumerate(all_urls):
            print(f"[FOO: {vid_url}]")
            extension = vid_url.split("?")[0].split("/")[-1].split(".")[1]

Thus, I noticed the following. Note that =vid_url= is sometimes empty.

$ ./zoomdl --cookies ~/Downloads/cookies.txt -u 'https://utec.zoom.us/rec/play/BqQCvFHnsW8S_uPtWzSZw2ce9vRVmZugEyt1NUv3lluYHp_bQicLYN3xuJLYVSwKwP_rdz_g3AOXgYvV.HprsohVuxRQ8oZxJ' 
Found 2 screens, downloading all of them
[FOO: ]
Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/myusername/Programs/zoomdl/./zoomdl/__main__.py", line 20, in <module>
  File "/home/myusername/Programs/zoomdl/./zoomdl/zoom_dl/__init__.py", line 18, in main
  File "/home/myusername/Programs/zoomdl/./zoomdl/zoom_dl/zoomdl.py", line 211, in download
  File "/home/myusername/Programs/zoomdl/./zoomdl/zoom_dl/zoomdl.py", line 116, in download_vid
IndexError: list index out of range
$ ./zoomdl --cookies ~/Downloads/cookies.txt -u 'https://utec.zoom.us/rec/play/BqQCvFHnsW8S_uPtWzSZw2ce9vRVmZugEyt1NUv3lluYHp_bQicLYN3xuJLYVSwKwP_rdz_g3AOXgYvV.HprsohVuxRQ8oZxJ' 
Found 2 screens, downloading all of them
[FOO: ]
Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/myusername/Programs/zoomdl/./zoomdl/__main__.py", line 20, in <module>
  File "/home/myusername/Programs/zoomdl/./zoomdl/zoom_dl/__init__.py", line 18, in main
  File "/home/myusername/Programs/zoomdl/./zoomdl/zoom_dl/zoomdl.py", line 211, in download
  File "/home/myusername/Programs/zoomdl/./zoomdl/zoom_dl/zoomdl.py", line 116, in download_vid
IndexError: list index out of range

In the execution shown below, the URL is not empty but has been hidden because of security concerns.

$ ./zoomdl --cookies ~/Downloads/cookies.txt -u 'https://utec.zoom.us/rec/play/BqQCvFHnsW8S_uPtWzSZw2ce9vRVmZugEyt1NUv3lluYHp_bQicLYN3xuJLYVSwKwP_rdz_g3AOXgYvV.HprsohVuxRQ8oZxJ' 
Found 2 screens, downloading all of them
[FOO: <<ommited-because-of-security-concerns>>]
File /home/myusername/Programs/zoomdl/Algoritmos_y_Estructura_de_datos_-_CS2100_-_TEORÍA_-_1_-_18_00_-_20_00screen0.mp4 already exists. This will erase it Continue? [y/N]: 

Hope this information helps.

Talinx commented 3 years ago

I got the same problem because one item of all_urls was the emtpy string "". (This is the case because url in metadata is not set.) Removing it fixed it for me: https://github.com/Talinx/zoomdl/commit/cbbdac83b035fa7cd66af3558978cd91f29f3d97 Unfortunately, I can not test the video URL you provided because I do not have permission to view it.

Battleman commented 3 years ago

I identified the problem, thanks for the heads-up and the nice debugging. It should be deployed very soon.

Battleman commented 3 years ago

@rdrg109 @Talinx can you confirm the latest Beta works?

Talinx commented 3 years ago

Works for me, thank you very much!