Build / Build (push) Successful in 4m33s
Details
Reviewed-on: #2 |
||
---|---|---|
.forgejo/workflows | ||
.gitignore | ||
Dockerfile | ||
LICENSE | ||
README.md | ||
composer.json | ||
composer.lock | ||
config.php.dist | ||
cron.php | ||
renovate.json |
README.md
yt2raindrop
Save videos from a YouTube Playlist XML to a Raindrop.io collection
You'll need:
- A raindrop.io account and a collection to save to
- You can find the collection ID in the URL right after
/my/
- Create a new app and generate a "Test token"
- You can find the collection ID in the URL right after
- A YouTube feed XML URL (replace
[ID]
)- Playlist:
https://www.youtube.com/feeds/videos.xml?playlist_id=[ID]
Open the playlist page, the ID is the value afterlist=
(and until a&
, if any) - Channel:
https://www.youtube.com/feeds/videos.xml?channel_id=[ID]
This ID starts with "UC". You can get it in the "About" tab, the share button has "Copy channel ID".
- Playlist:
Install and run without Docker
Dependencies:
- php (8.1+) with those extensions:
curl
,mbstring
,iconv
,xml
,xmlreader
- composer
# Clone repo and go in the folder
git clone https://git.rita.moe/kody/yt2raindrop.git
cd yt2raindrop
# Install deps
composer install
# Copy config file and edit it
cp config.php.dist config.php
$EDITOR config.php
Then make a cron to run the PHP script every hour.
crontab -e
0 * * * * php /path/to/yt2raindrop/cron.php
Note that PHP needs to have permission to write in the folder or at least to a done.txt
file.
This file is used to keep track of what has been sent.
Run with Docker
It has crond
to run the script every hour.
# Download the base config file and edit it
wget -O config.php https://git.rita.moe/kody/yt2raindrop/raw/branch/main/config.php.dist
$EDITOR config.php
# Create the file where it will save what has been sent
touch done.txt
# Run it in the background with the done.txt and config file mounted
docker run -d \
--name yt2raindrop \
--mount type=bind,source="$(pwd)"/done.txt,target=/app/done.txt \
--mount type=bind,source="$(pwd)"/config.php,target=/app/config.php,readonly \
git.rita.moe/kody/yt2raindrop:latest
# If you want to run it once right now, remove the -d and add `php /app/cron.php` at the end