alexlaverty / python-reddit-youtube-bot

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

help me with this error? #1

Closed alexdo83 closed 2 years ago

alexdo83 commented 2 years ago

help me with this error?

Untitled

alexlaverty commented 2 years ago

Yeh I struggled to get multi_rake to install on windows properly as well, try comment out references to multi_rake and try again

alexlaverty commented 2 years ago

I might add a toggle in settings to toggle off multi_rake

alexlaverty commented 2 years ago

I have pushed up some new code that doesn't have multi_rake it in, can you pull latest from Master and try again

alexdo83 commented 2 years ago

I'm getting this error when running your new one. do you have any solution?

image

config

alexlaverty commented 2 years ago

You need to create an IAM user that has AmazonPollyReadOnlyAccess access :

image

and then generate an access key and populate it in config.py file :

# Amazon Polly
aws_access_key_id="xxxxxx"
aws_secret_access_key="xxxxxx"

Amazon free tier should not incur cost for minimal use but may if you go over the polly limit, if you don't have an AWS account you can go into settings and switch the voice engine over to balcon which generates the voice locally like so :

settings.py

# choices "polly","balcon"
voice_engine = "balcon" 
alexdo83 commented 2 years ago

Awesome, I made my first video from your tools. Wish you a happy new day. Have a question I'd like to ask you? topic "subreddit" taken at random? I choose the question topic "subreddit" myself?

alexlaverty commented 2 years ago

Congrats on your first video, that's great to hear!

The list of subreddits is defined in the settings.py file you can change that list to the subreddits you want to get posts from :

https://github.com/alexlaverty/ttsvibelounge/blob/main/settings.py#L4-L18

At the moment it's configured to get top posts of today which you can configure here :

https://github.com/alexlaverty/ttsvibelounge/blob/main/reddit.py#L36

submissions = r.subreddit(subreddits).top(limit=settings.submission_limit, time_filter="day")

then once the posts are returned, it will validate the post based on a bunch of tests which you can see here :

https://github.com/alexlaverty/ttsvibelounge/blob/main/reddit.py#L5-L25

It discards posts that are Mod posts, stickied posts, NSFW posts, posts that are too long, too short etc,etc..

If you want to do a video for a specific URL then the code can potentially be updated to allow for that.

alexlaverty commented 2 years ago

I've also added the ability to generate a video for a specific reddit post by passing in a --url param like so :

python app.py --url https://www.reddit.com/r/AskReddit/comments/xxyusr/what_is_something_that_your_profession_allows_you/
alexdo83 commented 2 years ago

Hey @alexlaverty

image

https://user-images.githubusercontent.com/25850343/194694330-082bf6ca-7caa-44b5-ae96-ab236c315d9b.mp4

alexdo83 commented 2 years ago

My options: I like this style of loading comments better

image

alexdo83 commented 2 years ago

I've also added the ability to generate a video for a specific reddit post by passing in a --url param like so :

python app.py --url https://www.reddit.com/r/AskReddit/comments/xxyusr/what_is_something_that_your_profession_allows_you/

Can generate custom multiple video to handle?

python app.py --url https://www.reddit.com/r/AskReddit/1 --url https://www.reddit.com/r/AskReddit/2 --url https://www.reddit.com/r/AskReddit/3 --url https://www.reddit.com/r/AskReddit/... ?

alexlaverty commented 2 years ago

I have pushed a commit to allow specifying multiple url's https://github.com/alexlaverty/ttsvibelounge/commit/9f0c9d7c23f96c313f1543f34ec766b191060d91

Pull latest from master and then specify multiple urls seperated by comma like :

python app.py --url http://reddit.com/1,http://reddit.com/2
alexlaverty commented 2 years ago

Hey @alexlaverty

  • I have an idea like this, can you use it?
  • I have a video "MC background green screen " I want to insert it into the video at the position like your picture?
  • "MC background green screen " LOOP = time video https://www.youtube.com/watch?v=LdUl5SRaX0M

image

MC.Reddit.mp4

I had a look into this one, will need some more work on it, basically need to figure out how to remove the green screen from the newcaster. I like your idea though!

alexdo83 commented 2 years ago

I changed the "subreddits" specifically:

subreddits = [ "facepalm", "AskMen", "AskWomen", "AskReddit" ] However when i run the app, the videos it doesn't take are completely in the above groups, which takes other groups as well.

if settings.subreddits: subreddits = "+".join(settings.subreddits) else: subreddits = "all" subreddits = "all" submissions = r.subreddit(subreddits).top(limit=settings.submission_limit, time_filter="day") return submissions =======subreddits = "all" ->this part may is it get all all the most common variable? =========

alexlaverty commented 2 years ago

I have pushed a new commit to latest master https://github.com/alexlaverty/ttsvibelounge/commit/d296ffa67441eee2b17dafd7ec6ddcfe14298654 to add ability to generate a thumbnail only, for example :

python app.py --thumbnail-only

and I have managed to get a newscaster working but due to a bug I had to upgrade the moviepy library to the latest dev release of moviepy so to run the code you will need to uninstall the old moviepy version and upgrade to latest dev version via :

pip uninstall moviepy 
pip install moviepy==2.0.0.dev2

Then in settings.py enable the newscaster setting with :

enable_newscaster = True

Let me know if that works for you see how you go! I'll have a look into your above issue

alexlaverty commented 2 years ago

My options: I like this style of loading comments better

image

When I get some time I'll see what I can do, I've already had a look at @elebumm repo elebumm/RedditVideoMakerBot before so might borrow some code for the screenshotting.

alexdo83 commented 2 years ago

My options: I like this style of loading comments better image

When I get some time I'll see what I can do, I've already had a look at @elebumm repo elebumm/RedditVideoMakerBot before so might borrow some code for the screenshotting.

I slightly adjusted the video out @elebumm from 9:16 --> 16:9. It seems to be running fine https://youtu.be/4iHwpvrppbI

alexlaverty commented 2 years ago

ah nice, yes i really like elebumm code, he's a pro software developer, I am only beginner level : )

alexdo83 commented 2 years ago

ah nice, yes i really like elebumm code, he's a pro software developer, I am only beginner level : )

Oh no, I also love the features your tool makes, it's more functional. If @elebumm's code has a few more options like yours, that would be great too

alexlaverty commented 2 years ago

I might pull his code down and play around with it and see if i can add some features and raise a pull request to his repo.

alexlaverty commented 2 years ago

If you want another fun repo to play around with you should check out this one :

https://github.com/alexlaverty/python-ursina-game

Ursina is a 3D gaming engine written in Python.