stabbedbybrick / freevine

A Download Utility for Free Streaming Services
MIT License
160 stars 27 forks source link

UnboundLocalError: local variable 'android_heights' referenced before assignment #97

Closed andrewmk closed 3 months ago

andrewmk commented 3 months ago

Describe the bug UnboundLocalError: local variable 'android_heights' referenced before assignment

To Reproduce

C:\Users\xxx\local-git\freevine>c:\apps\python310\python.exe freevine.py get --episode  https://www.channel4.com/programmes/ultraviolet/on-demand/24459-001 --no-cache --sub-no-mux

❯_freevine v1.1.8

17:49:12.588 INFO : ALL4
17:49:12.588 INFO : + Adding service profile
17:49:12.608 INFO : Using cached tokens
17:49:12.961 INFO : Requesting ANDROID assets...
17:49:13.064 WARNING : Request for Android endpoint returned <Response [404]>, attempting proxy request...
17:49:13.064 INFO : + Adding Hola proxy location: UK
17:49:14.291 WARNING : Proxy attempt failed
17:49:14.292 INFO : Requesting WEB assets...
Traceback (most recent call last):
  File "C:\Users\xxx\local-git\freevine\freevine.py", line 15, in <module>
    cli()
  File "c:\apps\python310\lib\site-packages\click\core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "c:\apps\python310\lib\site-packages\click\core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "c:\apps\python310\lib\site-packages\click\core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\apps\python310\lib\site-packages\click\core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\apps\python310\lib\site-packages\click\core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "C:\Users\xxx\local-git\freevine\utils\commands.py", line 90, in get
    Service(config, **kwargs)
  File "C:\Users\xxx\local-git\freevine\services\channel4\channel4.py", line 73, in __init__
    self.get_options()
  File "C:\Users\xxx\local-git\freevine\services\channel4\channel4.py", line 455, in get_options
    self.download(download, title, bearer)
  File "C:\Users\xxx\local-git\freevine\services\channel4\channel4.py", line 458, in download
    self.res, manifest, token, subtitle = self.get_mediainfo(
  File "C:\Users\xxx\local-git\freevine\services\channel4\channel4.py", line 376, in get_mediainfo
    heights, manifest, lic_token, subtitle = self.sort_assets(
  File "C:\Users\xxx\local-git\freevine\services\channel4\channel4.py", line 357, in sort_assets
    if not android_heights and not web_heights:
UnboundLocalError: local variable 'android_heights' referenced before assignment

C:\Users\xxx\local-git\freevine>

Expected behavior No error

stabbedbybrick commented 3 months ago

This should now be fixed in https://github.com/stabbedbybrick/freevine/commit/aceee97031ec2726ac7ffaf9048e50ad97bb1f81