gversluis / ytqr

Self hosted Youtube URL shortener and QR generator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ytqr

Self hosted Youtube URL shortener and QR generator

Idea

During holidays I take pictures and sometimes make a video. Sometimes I make a photo album. I wanted to add small working QR codes to the photo album so I can see relevant videos.

Disclaimer

I wrote this for my own use so it is not tested except for my Raspbian (currently Bookworm) using Firefox on Windows.

Requirements

  • Have (sub)domainname control and ownership
  • Videos are currently hosted at Youtube for which credentials are available
  • Album will be printed only once and must not be reprinted
  • QR code target can be repaired when Youtube changes the URL
  • QR code target can be repaired when Youtube removes URL
  • QR code target can be repaired when another supplier is chosen for hosting videos
  • QR codes should be small and be only a minor part in a photo album page, like a foot note
  • It should be clear for which video the QR code is generated
  • It should be easy to create and download 100 QR codes within an hour

Solution

I wrote an interface that:

  • Generates an overview of all your Youtube playlists
  • List all items of a selected Youtube playlist
  • Allows you to preview the video
  • Generate a unique redirect (short) URL for your selected domainname
  • Generate a QRCode for the unique URL

Installation

  1. Copy config.php.example to config.php and modify to your needs
  2. Install https://github.com/googleapis/google-api-php-client
  3. Create OAuth 2.0 Client ID for Web application credentials on https://console.cloud.google.com for youtube.api.v3.V3DataPlaylistItemService.List and youtube.api.v3.V3DataPlaylistService.List
  4. Run getRefreshToken.php and follow instructions (you might have to do this every once in a while since it might expire)
  5. Go to https://example.org/v/ytqr.html
  6. Click white blocks at the right bottom of the video
  7. Download QR codes
  8. Add to photo album
  9. Test photo album and enjoy!

Credits and Licences

About

Self hosted Youtube URL shortener and QR generator

License:GNU General Public License v3.0


Languages

Language:JavaScript 77.2%Language:HTML 12.8%Language:PHP 10.0%