windows-server-2003 / ThirdTube

A work-in-progress homebrew YouTube client for the 3DS
GNU General Public License v3.0
214 stars 25 forks source link

/player Google Videos 403 Which Causes The FFMPEG Issue [Fix Included!] #228

Open erievs opened 1 month ago

erievs commented 1 month ago

I have a fork in which it is fixed, https://github.com/erievs/FourthTube

But here is the fix

How The Fix Works

So how ThirdTube works is it uses a decrypter and some base.js tomfoolery to access /player (without 403ing). The issue with this approach is, well, it breaks a lot. It was fine when the dev was active, but the dev has not.

However

We don't need that, we just need to send IOS YouTube app data, and it makes it happy (this is one of the methods YT-DLP uses)

std::string video_content = R"({"videoId": "%0", %1"context": {"client": {"hl": "%2","gl": "%3","clientName": "IOS","clientVersion": "19.29.1","deviceMake": "Apple","deviceModel": "19.29.1","osName": "iPhone","userAgent": "com.google.ios.youtube/19.29.1 (iPhone16,2; U; CPU iOS 17_5_1 like Mac OS X;)\"","osVersion": "17.5.1.21F90"}}, "playbackContext": {"contentPlaybackContext": {"signatureTimestamp": %4}}})";

Issue

This causes the metadata to breaks, thankfully we just have a separate post_content and video_content strings and use both for

 std::string json_str[2]; // {/next, /player}
        json_str[0] = http_post_json(urls[0], post_content).second;
        json_str[1] = http_post_json(urls[1], video_content).second;   /
reallylonglogholyshit commented 1 month ago

Absolute legend

kernaltrap8 commented 1 month ago

THE GOAT

nerfr commented 1 month ago

made a github acc just to say thank you

cyrill-oss commented 1 month ago

Thank you so much ♪⁠┌⁠|⁠∵⁠|⁠┘⁠♪

SuperLavaHair1 commented 1 month ago

nice