PetterKraabol / Twitch-Chat-Downloader

Download chat messages from past broadcasts on Twitch
https://pypi.org/project/tcd
MIT License
644 stars 61 forks source link

Downloader hasn't been working properly since a few days ago. #58

Closed ghost closed 5 years ago

ghost commented 6 years ago

My python version is 3.7.1. Have you checked for errors regarding the following? I look forward to hearing from you.

C:\Twitch-Chat-Downloader>python app.py -v 1234567
Traceback (most recent call last):
  File "app.py", line 4, in <module>
    import app
  File "C:\Twitch-Chat-Downloader\app\__init__.py", line 3, in <module>
    from .downloader import download, draw_progress
  File "C:\Twitch-Chat-Downloader\app\downloader.py", line 6, in <module>
    import app.formats as formats
  File "C:\Twitch-Chat-Downloader\app\formats\__init__.py", line 1, in <module>
    from .formats import use
  File "C:\Twitch-Chat-Downloader\app\formats\formats.py", line 4, in <module>
    import app.twitch as twitch
  File "C:\Twitch-Chat-Downloader\app\twitch\__init__.py", line 1, in <module>
    from .video import Video
  File "C:\Twitch-Chat-Downloader\app\twitch\video.py", line 13, in <module>
    class Video:
  File "C:\Twitch-Chat-Downloader\app\twitch\video.py", line 55, in Video
    def comment_generator_from_api(video: helix.Video) -> Generator[dict, None, None]:
AttributeError: module 'twitch.helix' has no attribute 'Video'
PetterKraabol commented 5 years ago

Hi, try updating the pip packages and try again. pip install -U --user -r requirements.txt

ghost commented 5 years ago

Thanks! I think we've fixed this error right away.

However, another error occurred, such as the link: https://github.com/PetterKraabol/Twitch-Chat-Downloader/issues/57 There was no input error in the video ID section. It may be annoying, but could you please confirm this error? Thank you so much.

PetterKraabol commented 5 years ago

I get the same error as #57 if I enter an invalid video ID, for instance by adding a space before it.

❯ python app.py
Video ID:  332918674
Traceback (most recent call last):
  File "app.py", line 46, in <module>
    main()
  File "app.py", line 39, in main
    app.download(app.arguments.video, app.arguments.format)
  File "/home/petter/projects/Twitch-Chat-Downloader/app/downloader.py", line 24, in download
    video: twitch.Video = twitch.Video(video_id)
  File "/home/petter/projects/Twitch-Chat-Downloader/app/twitch/video.py", line 41, in __init__
    video: helix.Video = helix.video(video_id)
  File "/home/petter/.local/lib/python3.7/site-packages/twitch/helix/helix.py", line 36, in video
    return helix.Videos(self.api(), video_ids=None, **kwargs)[0]
  File "/home/petter/.local/lib/python3.7/site-packages/twitch/helix/videos.py", line 45, in __init__
    self._api.get(self._path, params=kwargs)['data']]
KeyError: 'data'

I've added trimming for user inputs in f8a5a56d7eb1f8dd6f5775272281b8b650fe311f. Run git pull to update.

The error comes from twitch-python, which currently lacks error handling.

ghost commented 5 years ago

It wasn't about spaces. But I solved the problem in a different way. Thank you for your quick response!

ghost commented 5 years ago

I found out the cause of the error. When installing a module listed in requirements.txt, a module named 'twitch' overlaps the name of the module previously installed. Do you know how to change a installed module name to unique? I Ask for help. Please understand that the sentence is uneven as it is using a translator.

PetterKraabol commented 5 years ago

Hi, twitch-python is imported with import twitch.

If you have several Python packages that are imported with import twitch, then you might want to look into virtual environment solutions like pipenv.

Pipenv helps you create an isolated python environment (virtual environment) to avoid import collision.

ghost commented 5 years ago

It works successfully. Thank you very much for your kind reply!