VOGONS

Common searches


First post, by BEEN_Nath_58

User metadata
Rank l33t
Rank
l33t

I have not come across all the .BAT stuffs for Internet related things. I would like to create a .BAT script to launch multiple YouTube videos, set it on Loop, set speed to more that 1x, set resolution more or less, use Incognito mode or a different browser. Can anyone from here help me make one?

previously known as Discrete_BOB_058

Reply 1 of 3, by Pierre32

User metadata
Rank Oldbie
Rank
Oldbie

You can do some of this with a batch file.

@if (@CodeSection == @Batch) @then
@echo off
set SendKeys=CScript //nologo //E:JScript "%~F0"
start chrome /new-window https://www.youtube.com/watch?v=30Bm8OJFSk0
timeout /t 4 /nobreak >nul
%SendKeys% "+(.)"
%SendKeys% "+(.)"
%SendKeys% "+(.)"
@end
var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.SendKeys(WScript.Arguments(0));

Line 4 launches the video. The rest of the script is for SendKeys, which is a function built into Windows. In lines 6 to 8 where it says "+(.)" each line is sending "Shift" + "." which increments playback speed.

There is no keyboard command to change YT resolution as far as I know. But you can navigate to it manually... start by hitting Tab about ten times and then Space. You might be able to program the sequence in with SendKeys.

No way to loop with this afaik. That's via a right click menu in the video frame. You may need to look into AutoHotkey to achieve all of this. Or maybe there's a way to do all this with VLC instead of a browser, or another desktop app that plays YT videos.

Please don't ask for any tech support. I just learned all this myself and made a quick mod to someone else's script 😁

https://docs.microsoft.com/en-us/previo ... dfrom=MSDN
https://stackoverflow.com/questions/17038282/ … ng-a-batch-file
https://www.reddit.com/r/Batch/comments/7g5ps … emulate_inputs/

Reply 2 of 3, by BEEN_Nath_58

User metadata
Rank l33t
Rank
l33t
Pierre32 wrote on 2022-02-06, 10:21:
You can do some of this with a batch file. […]
Show full quote

You can do some of this with a batch file.

@if (@CodeSection == @Batch) @then
@echo off
set SendKeys=CScript //nologo //E:JScript "%~F0"
start chrome /new-window https://www.youtube.com/watch?v=30Bm8OJFSk0
timeout /t 4 /nobreak >nul
%SendKeys% "+(.)"
%SendKeys% "+(.)"
%SendKeys% "+(.)"
@end
var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.SendKeys(WScript.Arguments(0));

Line 4 launches the video. The rest of the script is for SendKeys, which is a function built into Windows. In lines 6 to 8 where it says "+(.)" each line is sending "Shift" + "." which increments playback speed.

There is no keyboard command to change YT resolution as far as I know. But you can navigate to it manually... start by hitting Tab about ten times and then Space. You might be able to program the sequence in with SendKeys.

No way to loop with this afaik. That's via a right click menu in the video frame. You may need to look into AutoHotkey to achieve all of this. Or maybe there's a way to do all this with VLC instead of a browser, or another desktop app that plays YT videos.

Please don't ask for any tech support. I just learned all this myself and made a quick mod to someone else's script 😁

https://docs.microsoft.com/en-us/previo ... dfrom=MSDN
https://stackoverflow.com/questions/17038282/ … ng-a-batch-file
https://www.reddit.com/r/Batch/comments/7g5ps … emulate_inputs/

Thank you very much. With a little modification, it all worked. But I need a little help. I could get away from using Loop by using a playlist instead. If I put the playlist link into the script, it plays the first video always instead. What to do?

Update: Okay I fixed most of the stuff, by pressing tab on playlist to open the desired video, through the skip. Vogons knows everything 😀

previously known as Discrete_BOB_058