alexlaverty / python-reddit-youtube-bot

Automated Reddit Youtube Video Bot
https://www.youtube.com/channel/UCzIwW92D_rM5_yvWBsquSbw
75 stars 17 forks source link

Login issue fixed... Another issue popped ! #102

Open sebbourgeois opened 7 months ago

sebbourgeois commented 7 months ago

Of course it couldn't be just that easy... ;)

As I wrote in the login issue post, there is something weird going on with the comments now. Basically the videos generated are very short because of the comments' screenshots. A lot of them are rejected with the following message :

2024-01-27 17:57:17 INFO     === Processing Reddit Comment 8/92 ===
2024-01-27 17:57:18 INFO     Created Audio File : assets/work_dir/1abur4l/kjqmbix.mp3
2024-01-27 17:57:18 INFO     Comment larger than video height : assets/work_dir/1abur4l/comment_kjqmbix.png

Ultimately, a video that should be usually around 10mins long barely makes more than 2-3 minutes because of all the rejected comments.

alexlaverty commented 7 months ago

Had a look tonight, Reddit must have changed layout/html again because I can see in the work_dir for example :

D:\src\python-reddit-youtube-bot\assets\work_dir\1acs310

comments are being saved that look like this, there is some banner in the way... so it has a large height which exceeds the video height, hence why they are all being skipped, will need to look into how to handle that banner if it pops up :

image

Example comment with banner :

comment_kjwej7c

sebbourgeois commented 6 months ago

I tried to find a workaround on my end but no chance so far. Any luck on your end @alexlaverty ?

alexlaverty commented 6 months ago

haven't had any luck so far, I think might need a bit of an uplift to provide option to not use reddit api for retrieving the posts from a subreddit, would be easiest to use https://old.reddit.com/ as it has a simple interface and use screen scraping like Selenium or Playwright to do it.