Skip to content

Latest commit

 

History

History
76 lines (54 loc) · 2.61 KB

File metadata and controls

76 lines (54 loc) · 2.61 KB

reddit2shorts

Make youtube shorts from reddit posts

Demo

output.mp4

Installation

dependencies

install yt_dlp and add it to path

  git clone https://github.com/yogeshdofficial/reddit2shorts
  cd reddit2shorts
  mv .env.example .env # populate it
  npm install
  ts-node --logError src/cli.ts --random --upload youtube

Environment Variables

To 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 ans set the variable to the key inside quotes 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/Examples

Usage: reddit2shorts [options]

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 command

Authors

Acknowledgements

Since it is my first difficult project, any help and advice is much appreciated