2023-10-16 21:23:15 +02:00
2023-09-29 17:16:47 +02:00
2023-10-03 15:33:41 +02:00
2023-10-16 21:23:15 +02:00
2023-10-16 21:23:15 +02:00
2023-10-03 15:49:57 +02:00

What is it?

This program takes the very last video published on a PeerTube instance and pushes it to a corresponding YouTube channel.

What the status of this?

This is an early prototype not really suited for production purposes for now:

  • it still relies way too much on pre-determined value to upload the video to YouTube
  • it cannot determine the playlists it needs to put them in
  • it cannot determine the recording date (believe me, I tried!)
  • there are still a lot of static values that I would rather not have static (like the cache directory…)
  • it is 100% sync, meaning its clearly not optimal for now and probably wont be for the next releases

So consider this a work in progress that will slowly get better with time

What does it do exactly?

  • it downloads the latest PeerTube video from an instance
  • stores it in cache directory
  • uploads it to YouTube

What doesnt it do exactly?

  • it cannot register the original key (see below)
  • it relies on a local cache despite the fact that it might well be possible to just download from PT/upload to YT at the same time (I dont see why not in fact)
  • it doesnt retrieve ALL the original PeerTube video properties like licences, languages, categories, etc… again: early prototype

Obtain Authorization Token from Google

That the complicated part:

  • create an OAuth2.0 application with authorization for Youtube DATA Api v3 Upload
  • create a OAuth2.0 client with Desktop client

Youll need:

  • the client_id from your OAuth2.0 client
  • the client_secret from you OAuth2.0 client

Then enter in:

https://accounts.google.com/o/oauth2/v2/auth?client_id=XXX.apps.googleusercontent.com&redirect_uri=urn:ietf:wg:oauth:2.0:oob&scope=https://www.googleapis.com/auth/youtube.upload&response_type=code

And accept that your YouTube account might be modified. Youll get a code then; enter this curl post:

curl -s \
--request POST \
--data "code=[THE_CODE]&client_id=XXX.apps.googleusercontent.com&client_secret=[THE_CLIENT_SECRET]&redirect_uri=urn:ietf:wg:oauth:2.0:oob&grant_type=authorization_code" \
https://accounts.google.com/o/oauth2/token

Youll get a Token. The only important part is the refresh_token

In your tootube.toml config file, put the refresh_token.

Description
No description provided
Readme WTFPL 140 KiB
Languages
Rust 100%