youtube search resolver https://www.u2b.cx/
 
 
Go to file
Lamp 669ea6a41b Merge branch 'master' into nginx 2023-07-31 19:35:58 -07:00
caddy caddy formatted log 2023-07-22 21:35:03 -07:00
.gitignore display error as video 2023-06-22 20:47:07 -07:00
Dockerfile mount app instead of build into image 2023-07-22 21:05:26 -07:00
README.md support music.youtube.com 2023-07-28 00:37:33 -07:00
bg.png display error as video 2023-06-22 20:47:07 -07:00
docker-compose.yml caddy formatted log 2023-07-22 21:35:03 -07:00
nginx.conf nginx 2023-07-22 21:07:26 -07:00
requirements.txt display error as video 2023-06-22 20:47:07 -07:00
server.py fix for missing header 2023-07-31 18:39:23 -07:00
textvid.py display error as video 2023-06-22 20:47:07 -07:00
u2b.cx.service put caddyfile & service in repo 2023-03-27 15:08:25 -05:00

README.md

u2b.cx

A YouTube search resolver + raw file resolver w/ proxy for Quest VRChat.

  • Get the video you want just by typing its name in the URL
  • Video works for both PC and Quest VRChat
  • Proxying avoids random blocks from google's servers

Technical Features

  • Written in Python to integrate with YoutubeDL (yt-dlp) for fastest performance
  • Multi-threaded for concurrent usage
  • Requests coalesced to one YoutubeDL invocation per input
  • Limited to one YoutubeDL invocation per IP address
  • Results cached for 5 hours or until expiry found in extracted URL
  • Extracted URLs proxied in Caddy so that they work in all countries
  • Errors displayed as a 10 second single-frame video
  • PC VRchat bypassed to save bandwidth (todo: sacrifices consistency)

Planned

  • Option to get Nth search result (requires deeper integration into YoutubeDL)

Usage

GET https://u2b.cx/<query>

The server will search YouTube for <query>, pick the first result, pick the best quality all-in-one MP4 format available, and respond with a 302 redirect to the proxied raw MP4 file. If the client is PC VRChat, the server may instead redirect to the YouTube video URL to save bandwidth on the server.

NOTE: query must not start with a dot (.)

GET https://u2b.cx/id/<video id>

GET https://u2b.cx/https://www.youtube.com/watch?v=<video id>

GET https://u2b.cx/https://youtu.be/<video id>

GET https://u2b.cx/https://www.youtube.com/shorts/<video id>

GET https://u2b.cx/https://music.youtube.com/watch?v=<video id>

etcetera...

Bypasses search to look up the video directly by its id. If the client is PC VRChat, it may be immediately redirected to the YouTube url to save resources on the server.

Regex only matches the start of the string; anything after the 11-char video id is ignored.

Malformed YouTube URLs will be treated as a YouTube search query and YouTube search will probably give what you want.