ajayyy / DeArrow

Crowdsourcing better titles and thumbnails on YouTube
https://dearrow.ajay.app
GNU General Public License v3.0
1.41k stars 38 forks source link

Support JSON-encoded X-TITLE header from thumbnail cache #100

Open mini-bomba opened 1 year ago

mini-bomba commented 1 year ago

To test this pull request, follow the instructions in the wiki.


This PR allows the X-Title header received from thumbnail cache to be JSON-encoded as a way to transmit unicode characters. This doesn't replace the raw ASCII format (yet), only decodes the header as JSON if it starts & ends with a ", then checks if a string was decoded (so we don't accidentally end up decoding an object or something like that)

This is the client-side part for solving ajayyy/DeArrowThumbnailCache#3. Server-side part is in ajayyy/DeArrowThumbnailCache#9.

ajayyy commented 1 year ago

The invidious userscript uses the old behavior already. Maybe we should version it (change /api/v1 to /api/v{version}, pass that number to function)

mini-bomba commented 1 year ago

Good point, I forgot about the whole versioned api thing