Get a YouTube RSS feed (ie. favorites) and send items to a raindrop.io collection
 
 
Go to file
Kody 9d289a3691
Build / Build (push) Successful in 4m33s Details
Merge pull request 'Update docker.io/library/composer Docker tag to v2.6' (#2) from renovate/all-minor-patch into main
Reviewed-on: #2
2023-09-06 07:13:10 +00:00
.forgejo/workflows Add README, LICENSE and Dockerfile 2023-09-05 21:31:06 +02:00
.gitignore init 2023-09-03 22:14:13 +00:00
Dockerfile Update docker.io/library/composer Docker tag to v2.6 2023-09-05 21:58:03 +00:00
LICENSE Add README, LICENSE and Dockerfile 2023-09-05 21:31:06 +02:00
README.md Oh oops, that cron's too short 2023-09-05 21:51:08 +02:00
composer.json init 2023-09-03 22:14:13 +00:00
composer.lock init 2023-09-03 22:14:13 +00:00
config.php.dist init 2023-09-03 22:14:13 +00:00
cron.php Tell SimplePie we don't want a cache 2023-09-05 21:44:19 +02:00
renovate.json Add renovate.json 2023-09-03 22:16:58 +00:00

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"
  • 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 after list= (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".

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