ohn0 / youtube-livechat-scraper

grab youtube live chat data from existing VODs
MIT License
10 stars 2 forks source link

Attribute Error on specific video #13

Open Draegon366 opened 1 year ago

Draegon366 commented 1 year ago

I'm getting this error when trying to scrape this video https://www.youtube.com/watch?v=mjwcJ4YHGek

'PlayerState' object has no attribute 'playerOffsetMs' File "/mnt/a/Izuna/vod transcriber.py", line 137, in get_chat scraper.scrape() File "/mnt/a/Izuna/vod transcriber.py", line 206, in do_text chat_json_path = get_chat(url) File "/mnt/a/Izuna/vod transcriber.py", line 219, in do_youtube_things chat_messages = text_thread.result() File "/mnt/a/Izuna/vod transcriber.py", line 261, in <module> prompts_list = do_youtube_things(video_url) AttributeError: 'PlayerState' object has no attribute 'playerOffsetMs'

ohn0 commented 1 year ago

what OS are you using?

ohn0 commented 1 year ago

Trying with the latest PIP package and that video URL works for me with Requests and BeautifulSoup4 installed.

repollo commented 1 year ago

The issue has to do with playerOffsetMs attribute. PlayerState class apparently had that attribute name in an earlier version of the code, now the attribute is called player_offset_ms. So in livechat_scraper.py you'll need to change all the self.player_state.playerOffsetMs with self.player_state.player_offset_ms.

Cheers