zackmawaldi / YouTube-shorts-generator

Automatically download Reddit videos, edit them, and upload them to YouTube.
MIT License
323 stars 62 forks source link

main.py #3

Closed manashan closed 1 year ago

manashan commented 2 years ago

how can I fix this issue? It doesn't let me go further. Screenshot_2

zackmawaldi commented 2 years ago

There were syntax errors in config.py file that weren't caught, thanks for highlighting the errors! I updated the file. Try using the updated config.py code and let me know if the issue persists.

Zack

manashan commented 2 years ago

@zackmawaldi thank you Zach. I tried to run but getting this rn. What should I do here Screenshot_3 ?

zackmawaldi commented 2 years ago

The error is a key-value error, which means the code tried to access a key that doesn't exist.

The way config file works is through series of dictionaries with key-value pairs. Example:

config.py login_info = { 'username': 'jake', 'password': '1234'}

If username needs to be accessed, config.login_info['username'] returns --> 'jake' But if a key was entered that isn't there, it returns a KeyError. Such as if we try to access age. Ex: config.login_info['age'] --> KeyError since 'age' isn't in login_info


My hunch is that line 18 in reddit_scraper.py was modified from the original: red = praw.Reddit(client_id=config.reddit_login['client_id'],

to

red = praw.Reddit(client_id=config.reddit_login['ACTUAL ID'],

If I'm correct, try changing it back. Let me know if that does it. Zack

manashan commented 2 years ago

I have done both. Still getting this error. Do you think I made something wrong on Reddit end? But I followed youtube tutorial on Reddit API

zackmawaldi commented 2 years ago

Can you send me a screenshot or the code to your reddit_scraper.py file?

manashan commented 2 years ago

Screenshot_4 here is the ss.

zackmawaldi commented 2 years ago

Ah, guessed it!

Change lines 18-22 in your file to lines 18-22 exactly as seen in original reddit_scraper.py file. Let me know if that changes things.

manashan commented 2 years ago

Thank you Zach. I finally managed the Reddit part. But I occur another problem here. What would be the issue here? Screenshot_5

After I run again on cmd. it says like this Screenshot_6

zackmawaldi commented 2 years ago

This is permission error. It was encountered in #2 . Check the solution mentioned there, and lmk.

manashan commented 2 years ago

This is permission error. It was encountered in #2 . Check the solution mentioned there, and lmk.

what about this one?sorry I know you have finals, I bother you a lot. Screenshot_4

zackmawaldi commented 2 years ago

Seems like a problem redvid. First line of error says 'ffmpeg' is not recognized. Do you have ffmpeg installed? Try following a YouTube tutorial on it.

manashan commented 2 years ago

Seems like a problem redvid. First line of error says 'ffmpeg' is not recognized. Do you have ffmpeg installed? Try following a YouTube tutorial on it.

I think it's the issue with permission because script tries to change the file name I guess. I will try to make it start tonight. Thanks for your help.