An overly complex tool to mirror youtube content to LBRY
Go to file
Niko Storni f5f12e1560 add support for multiple queues
add support for blockchain.db pruning via new status
2020-10-27 19:50:10 +01:00
blobs_reflector update dependencies 2020-09-01 20:27:39 +02:00
downloader fix canceled by stopper error 2020-10-07 03:40:19 +02:00
e2e update lbrynet support 2020-10-22 23:14:21 +02:00
ip_manager nevermind... re-enable ipv6 (i should make it a flag) 2020-08-12 04:17:30 +02:00
manager add support for multiple queues 2020-10-27 19:50:10 +01:00
metrics fix prom allowed chars 2020-05-19 23:24:16 +02:00
namer fix bug with non latin titles for claim names 2019-09-10 11:43:20 +02:00
scripts fix modules pollution 2019-02-27 20:19:29 +01:00
sdk lots of bug fixes and improvements 2020-08-18 00:03:38 +02:00
shared add support for multiple queues 2020-10-27 19:50:10 +01:00
sources handle non existing iso639-1 better 2020-10-20 17:43:25 +02:00
tags_manager refactor tags_mapping name 2019-10-21 15:44:24 +02:00
thumbs add support for own S3 thumbnails storage 2020-10-07 03:10:54 +02:00
timing fix semver 2020-06-11 18:45:56 +02:00
util grab channel info without APIs 2020-08-05 15:47:53 -04:00
ytapi prevent channels from failing when manually killed 2020-08-26 19:05:16 +02:00
.gitignore make video transferring async 2019-10-11 01:00:04 +02:00
.goreleaser.yml update goreleaser 2020-01-11 22:11:44 -05:00
.travis.yml fix travis try 2 2020-06-10 03:44:34 +02:00
0001-lbry-patch.patch add new throttling detection 2019-12-16 00:29:56 +01:00
go.mod add support for own S3 thumbnails storage 2020-10-07 03:10:54 +02:00
go.sum add support for own S3 thumbnails storage 2020-10-07 03:10:54 +02:00
LICENSE Update LICENSE 2020-02-03 04:08:28 +07:00
main.go add support for multiple queues 2020-10-27 19:50:10 +01:00
Makefile Add retry on IP failures 2020-08-05 15:47:53 -04:00
README.md remove unused script 2019-06-10 21:43:10 +02:00

YTSync Tool

Build Status

This tool serves lbry to parse youtube channels that want their content mirrored on LBRY.

The tool downloads the entire set of public videos from a given channel, publishes them to LBRY and populates our private database in order to keep track of what's publishes. With the support of said database, the tool is also able to keep all the channels updated.

Requirements

  • lbrynet SDK https://github.com/lbryio/lbry/releases (We strive to keep the latest release of ytsync compatible with the latest major release of the SDK)
  • a lbrycrd node running (localhost or on a remote machine) with credits in it

Setup

  • make sure daemon is stopped and can be controlled through systemctl (find example below)
  • extract the ytsync binary anywhere
  • add the environment variables necessary to the tool
    • export SLACK_TOKEN="a-token-to-spam-your-slack"
    • export SLACK_CHANNEL="youtube-status"
    • export YOUTUBE_API_KEY="youtube-api-key"
    • export LBRY_WEB_API="https://lbry-api-url-here"
    • export LBRY_API_TOKEN="internal-apis-token-for-ytsync-user"
    • export LBRYCRD_STRING="tcp://user:password@host:5429"
    • export AWS_S3_ID="THE-ID-LIES-HERE"
    • export AWS_S3_SECRET="THE-SECRET-LIES-HERE"
    • export AWS_S3_REGION="us-east-1"
    • export AWS_S3_BUCKET="ytsync-wallets"

systemd script example

/etc/systemd/system/lbrynet.service

[Unit]
Description="LBRYnet daemon"
After=network.target

[Service]
Environment="HOME=/home/lbry"
ExecStart=/opt/lbry/lbrynet start
User=lbry
Group=lbry
Restart=on-failure
KillMode=process

[Install]
WantedBy=multi-user.target

Instructions

Publish youtube channels into LBRY network automatically.

Usage:
  ytsync [flags]

Flags:
      --after int                   Specify from when to pull jobs [Unix time](Default: 0)
      --before int                  Specify until when to pull jobs [Unix time](Default: current Unix time) (default current timestamp)
      --channelID string            If specified, only this channel will be synced.
      --concurrent-jobs int         how many jobs to process concurrently (default 1)
  -h, --help                        help for ytsync
      --limit int                   limit the amount of channels to sync
      --max-length float            Maximum video length to process (in hours) (default 2)
      --max-size int                Maximum video size to process (in MB) (default 2048)
      --max-tries int               Number of times to try a publish that fails (default 3)
      --remove-db-unpublished       Remove videos from the database that are marked as published but aren't really published
      --run-once                    Whether the process should be stopped after one cycle or not
      --skip-space-check            Do not perform free space check on startup
      --status string               Specify which queue to pull from. Overrides --update
      --stop-on-error               If a publish fails, stop all publishing and exit
      --takeover-existing-channel   If channel exists and we don't own it, take over the channel
      --update                      Update previously synced channels instead of syncing new ones
      --upgrade-metadata            Upgrade videos if they're on the old metadata version
      --videos-limit int            how many videos to process per channel (default 1000)

Running from Source

Clone the repository and run make

License

This project is MIT licensed. For the full license, see LICENSE.

Contributing

Contributions to this project are welcome, encouraged, and compensated. For more details, see CONTRIBUTING.

Security

We take security seriously. Please contact security@lbry.io regarding any security issues. Our PGP key is here if you need it.

Contact

The primary contact for this project is Niko Storni (niko@lbry.io).