Older codespaces workflow is still available on the main branch
Table of Content
- (Local Cron) Automating youtube video to anchor fm audio
For the script to run successfully it is necessary for there to be at least one episode manually published on Anchor.fm. The steps to publish on a brand new Anchor.fm account are different and will break the automation.
-
Make sure you have
node
,npm
andgit
installed on your machine.node --version && npm --version && git --version
If you are not using any
GCM (Git Credential Manager)
which already hasPersonal Access Token
to authenticate you with Github, do the following steps. Otherwise, skip.
- Install Homebrew
- Install Github CLI
- Make
gh
your credential managergh auth setup-git
- Run the following to setup credentials. For help gh auth login
gh auth login
- (For Mac) Please install
gnu-sed
and create an alias in bash profile.- Install
gnu-sed
brew install gnu-sed
- Install
- On Github
- Create
new branch from local-cron
and name it likepodcast_1
.
- Create
- Go to secrets and create
ANCHOR_EMAIL_1
andANCHOR_PASSWORD_1
.The
_x
naming format are important to match branch to podcast credentials.
-
Open a terminal
-
If first time, on your local machine create a folder and navigate into the folder before proceeding, as this is where all subsequent podcast branches should be placed.
mkdir podcasts && cd podcasts/
-
Clone the
podcast_x
branch topodcasts/ folder in your local machine
and change into thepodcast_x
folder.git clone -b <podcast_x> <repository_url> <podcast_x>
eg. replace
<podcast_x>
with your new podcast branch eg. podcast_2
replace<repository_url>
with your repository url eg. https://github.com/username/repo.gitgit clone -b podcast_2 https://github.com/username/repo.git podcast_2
-
Change into the new
podcast_x
directory.
- To attach a Playlist URL to this branch ( this will be used in all subsequent runs )
./scripts/prompt-url.sh
- To update the github action to match Anchor password and email. ( On Mac, make sure that gnu-sed is installed and aliased )
./scripts/update-workflow.sh
- To set the job to run at a specific time.
- To cron the job
./scripts/cron-it.sh
- The job runs every Thursday at 12 pm your machine's local time, the machine needs to be powered on at this hour. To change the timings see next section.
- To cron the job
-
At times, you would want to edit the cronjob, use
crontab -e
and edit it. Cronguru can help you in figuring out the format used in timing a job. -
To check if the cron job is set, you can list it using
crontab -l
- On Github go to a
podcast branch
and underActions
tab you check status of your workflows.
- On your local machine using terminal, navigate into a branch, eg. podcast_1
- Run the following command
./scripts/rerun-failed.sh
The manual method is still available from main
branch and using a codespace
, same as before. If it is ever needed.
For first run the convertedVideos.json
file should have the following keys.
{
"name": "Upload processed data",
"videoQuantity": 0,
"lastUpdated": "",
"videos": []
}
- The video information is stored in the key
videos
as array of video IDs
NOTE: Automation depends on this npm package to fetch playlist related information without use of an API key.
Warning: There might be concerns regarding violation of Github TOS when it comes to uploading of a playlist. Read more here
Manual Effort: At times some fields don't get populated on AnchorFM (eg. title being untitled), this is dependent on Github Action and will need manual intervention.
Limitation: Github allows for 2000 min of action usage per month. Once you run out of these get an account or wait for next month.