Make youtube shorts from reddit posts
output.mp4
install yt_dlp and add it to path install ffmpeg
git clone https://github.com/yogeshdofficial/reddit2shorts
cd reddit2shorts
mv .env.example .env # populate it
npm install
ts-node src/cli.ts --random --upload youtubeTo run this project, you will need to rename .env.example to .env add the following
get from https://www.reddit.com/prefs/apps, set type to personal use script
REDDIT_CLIENT_ID
REDDIT_CLIENT_SECRET
REDDIT_USERNAME
REDDIT_PASSWORD
get from google cloud console ->IAM->service account ->create service account ->manage kes ->create and download key as json and set env value to content of the json file
GOOGLE_APPLICATION_CREDENTIALS
get from https://aistudio.google.com/app/apikey
GEMINI_API_KEY
get by following this article
GOOGLE_CLIENT_ID
GOOGLE_CLIENT_SECRET
GOOGLE_ACCESS_TOKEN
GOOGLE_REFRESH_TOKEN
get by installing extension and getting cookie from tiktok webiste's sessionid
TIKTOK_SESSION_ID
Usage: reddit2shorts [options]
example: bun src/cli.ts --random --upload youtube
Make youtube shorts from reddit posts
Options:
-V, --version output the version number
-s --subreddits <subreddit...> List of subreddits to choose text post from (default:
["AskReddit","TIFU"])
-r, --random Make short from a random post
-p, --postId <postId> Make short from the post with id
-c --commentsCount <commentsCount> Number of comments to include (default: "10")
-t --tts <tts> Which tts to use (default: "google")
-u --upload <platform> Upload to platform
-g --tags <tags...> Tags for video title (default: ["shorts","reddit","redditstories"])
-a --bgAudio <bgAudio> Background audio (default: "https://www.youtube.com/watch?v=xy_NKN75Jhw")
-v --bgVideo <bgVideo> Background video (default: "https://www.youtube.com/watch?v=XBIaqOm0RKQ")
-h, --help display help for commandSince it is my first difficult project, any help and advice is much appreciated