Running the following command:
python3 bot.py --visits 5 --url https://www.youtube.com/watch?v=_4dfderXXx --verbose
I'm getting the following error:
video status: playing video duration time: 2:14:21:34 Traceback (most recent call last): File "bot.py", line 105, in <module> sys.exit(_main()) File "bot.py", line 99, in _main bot.run() File "bot.py", line 87, in run print('stopping video in %s seconds' % sleep_time) UnboundLocalError: local variable 'sleep_time' referenced before assignment
Seems to be complaining about the following section from the script:
if video_duration: print('video duration time:', video_duration) seconds = utils.to_seconds(duration=video_duration.split(':')) if seconds: sleep_time = randrange(seconds) if self.opts.verbose: print('video duration time in seconds:', seconds) print('stopping video in %s seconds' % sleep_time) time.sleep(sleep_time) youtube.disconnect() count += 1
Does it work for live videos?
Running the following command:
python3 bot.py --visits 5 --url https://www.youtube.com/watch?v=_4dfderXXx --verbose
I'm getting the following error:
video status: playing video duration time: 2:14:21:34 Traceback (most recent call last): File "bot.py", line 105, in <module> sys.exit(_main()) File "bot.py", line 99, in _main bot.run() File "bot.py", line 87, in run print('stopping video in %s seconds' % sleep_time) UnboundLocalError: local variable 'sleep_time' referenced before assignment
Seems to be complaining about the following section from the script:
if video_duration: print('video duration time:', video_duration) seconds = utils.to_seconds(duration=video_duration.split(':')) if seconds: sleep_time = randrange(seconds) if self.opts.verbose: print('video duration time in seconds:', seconds) print('stopping video in %s seconds' % sleep_time) time.sleep(sleep_time) youtube.disconnect() count += 1
Any ideas?