BOT-HAT / Youtube-First-Comment-Bot

A bot for automatically post comment when a youtube channel upload a new video.
133 stars 51 forks source link

UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position 70859: character maps to <undefined> #11

Closed rainbow6996 closed 2 years ago

rainbow6996 commented 3 years ago

i getting this error, when authentication is successful, how to resolve it?

Traceback (most recent call last):
  File "C:\Users\rainbow\Desktop\Nowy folder (4)\Youtube-First-Comment-Bot-master\bot.py", line 76, in <module>
    youtube = get_authenticated_service(args)
  File "C:\Users\rainbow\Desktop\Nowy folder (4)\Youtube-First-Comment-Bot-master\bot.py", line 47, in get_authenticated_service
    doc = f.read()
  File "C:\wszystko\python3.8.4\lib\encodings\cp1250.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position 70859: character maps to <undefined>
JustDhan commented 3 years ago

Same issue

nkosinathi-sola commented 3 years ago

@rainbow6996 @JustDhan

I suggest run your bots in a virtual environment.

A virtual environment helps to keep dependencies required by different projects separate by creating isolated python virtual environments for them. This is one of the most important tools to use.

Let me know if you still have this error after running on a venv

FeelsBadMan1 commented 3 years ago

Same issurehere. a venv not solved it.

melvas6 commented 2 years ago

with open("youtube-v3-discoverydocument.json", "r", encoding="utf8") as f:

adding encoding="utf8"solved for me