Youtube android auto Fix ** WORKS AGAIN **

Apps Youtube android auto Fix ** WORKS AGAIN ** 3.0

Login or Register an account to download this content
TLDR;
The Youtube script from CSP can only stream from a single URL. Youtube itself doesn't support it anymore as they now use 2 URLs for each video, one for audio and one for video.


Alright so I tried the fix again yesterday and can confirm that it doesn't work 98% of the time. I don't have a fix right now but kinda have an idea of what is going wrong with it, I will share it here hoping someone might fix it eventually as I don't have much free time to make one.

Test environment:
CSP v0.1.8.0-preview442
Windows 10
yt-dlp version 2023.10.13

Debug Method:
AC Debug function for LUA Scripting
Visual Studio Code for editing
A lot of trial and error
Also performed the test on stock youtube.lua from the CSP itself.

Findings:
  • The error is originating mainly on the function findVideoStreamURL, specifically on line 48. This line is where yt-dlp is used to grab a combined stream URL, which is synonymous to what a direct link is.
  • youtube.lua uses YT-DLP to grab everything it needs from Youtube. Based on my understanding, the lua script first searches for the best format of the video that the user selected and has a combined audio and video. If it finds one, it will store the quality index in a variable and use it as a reference to get the stream link.
  • Now here's the problem, Youtube now uses two different URLs for each video, one for audio and one for video. In the past, this was not the case, some videos still has functioning combined stream links. However, combined stream links is now regarded as legacy and Youtube doesn't support it anymore. Source. It will work, but most of the time it won't.
  • The current youtube.lua script only supports combined stream URLs. It can only process a single URL.

Possible fixes:
On all possible fixes I could think of, function findOptimalQuality might not be needed anymore as recent updates from YT-DLP made it easier to select a video format using regex.

Solution 1:
Use YT-DLP to download videos locally then stream it from there. Youtube app from assetto corsa would now act like a windows media player with Youtube as source. This will be a lot slower and dependent on your internet speed.

Solution 2:
Modify youtube.lua to play both audio and video urls at the same time. I'm not an expert with LUA scripting so I'm not sure if it can handle that. If this is possible, this will be the best fix. It might even improve the video quality overall and enable the user to select a video quality of choice.

These are the solutions that I can think on the top of my head, as again, I'm not a LUA expert. I might make a fix in my free time, but I don't think I will have one anytime soon.

Also, I want to thank Jarlthedriver for the credit, although the fix was short-lived, I still appreciated it :)
 
Last edited:
Your detailed explanations and suggestions are really helpful for those navigating this challenge.

And big kudos to Jarlthedriver for the credit – it's always nice to acknowledge each other's efforts in the tech community! I'm not an LUA expert either, but your ideas sound promising. Taking the time to share your insights and potential fixes is a fantastic contribution.

By the way, stumbled upon your comment while wondering, What is YouTube automation?Seems like an intriguing topic! If you get around to making a fix in your free time, that would be super cool. Happy problem-solving!
 
Last edited:
I play AC on VR and it seems that the fix doesn't work in VR for some reason. When I tried in monitor mode, some videos work but none seems to do so when im in VR/Oculus Rift mode.

I cant even type in the search bar in VR. The search bar seems to overwrite the first alphabets.

Both 0.1.80 346 and the latest 2.1 p2 running on Pure 0.205
 
Im gonna update the ytdlp, i havent been on assetto corsa for a while. Later today ill update it! edit: I cant update it today, Its a harder to fix bug and will definitely be fixed soon hopefully)
so far mine is working fine on CSP 0.2.3-preview1 although some YT unable to be fetched. I too noticed that a video was fetched fine but when I change car/track, said video is then unable to be played. Thanks for still working on it Jar
 
am on csp 2.0.3 preview 1 and i reinstalled my windows it worked perfectly fine before but now it just says that the url is not allowed for use...any help? because before in csp 1.80 preview 284 (i think) before i reinstalled my windows it worked compleatly fine
 

Attachments

  • Snímek obrazovky 2024-02-19 211430.png
    Snímek obrazovky 2024-02-19 211430.png
    176.7 KB · Views: 39
am on csp 2.0.3 preview 1 and i reinstalled my windows it worked perfectly fine before but now it just says that the url is not allowed for use...any help? because before in csp 1.80 preview 284 (i think) before i reinstalled my windows it worked compleatly fine
Youtube and ytdlp keeps changing stuff, its hard to make a fix that works for a long time
 
Jarlthedriver updated Youtube android auto Fix ** WORKS AGAIN ** with a new update entry:

Probably never gonna get a new update

As what I have seen everytime I patch the system youtube changes something and it doesnt work. I dont have the time lately and havent looked into it, the devs put a comment in the original script saying it will not work for a long time since youtube doesnt like third party software that disables ads.

As for now I wont look into it, if you any are able to fix it. I will update and give the credits where needed!

Read the rest of this update entry...
 

Latest News

Are you buying car setups?

  • Yes

  • No


Results are only viewable after voting.
Back
Top