VOGONS


First post, by blacksvk

User metadata
Rank Newbie
Rank
Newbie

Hello everyone. Have you ever wondered whether you can play youtube videos on MS-DOS computer? Well, according to Google: no, you can't. But I managed to put some scripts together to make it work.

How it works?

  • Wget is used for downloading stuff from youtube
  • Free pascal scripts are used for parsing stuff from youtube
  • QuickView is used for playing videos
  • Everything is controlled via batch files

Requirements:
Fast enough PC (at least pentium1).
For MS-DOS: packet driver installed
For Windows: windows network driver installed
Also check QV requirements: http://www.multimediaware.com/qv/qvdoc.htm

Installation:

  1. Simply extract all files to HDD. (Make sure to have enough free space for youtube videos)
  2. (Optional) set the video quality: By default, the youtube script will ask which video format to use. You can change config.bat to set the video quality so you won't have to enter video format every time you want to play video. First you have to figure out, what is the best video quality for your system. Just play some videos and remember itag for video format that works on your system. Then edit config.bat and change second line from "set quality=choose" to set quality=your_itag, for example: for 144p video:
    set quality=17
    For 360p video:
    set quality=18
  3. (Optional) replace included unreg. shareware QuickView with full version

Usage:
Before using any commands, set working directory to youtube root directory.

cd \youtube

Then you can use any of these commands:

  • Watch video: watch.bat
    Usage: watch videoid
    Example:
    watch ted5HXDwuck
  • Search by relevance: search.bat
    Usage: search search query
    Example:
    search ms dos mode guide
  • Search by date: searchdt.bat
    Usage: searchdt search query
    Example:
    seatchdt shovelware diggers
  • Get videos from channel: channel.bat
    Usage: channel legacy_user_name
    The legacy username is included in youtube.com/user/ url, more: https://support.google.com/youtube/answer/6180214?hl=en. You can figure it out like this: https://imgur.com/a/Ty0lJ
    Example:
    channel phreakindee

You can try some example commands(written in batch files) in examples directory. Like this:

cd \youtube\examples\search
TECHTALES.bat
cd \youtube\examples\channels
PHILSLAB.BAT
cd \youtube\examples\videos
NYAN.BAT

Limitations:

  • Some videos won't download (especially Vevo ones)
  • DASH video formats are not available
  • Some video formats with new codecs cannot be played (webm formats)
  • Searching for long query may not work in older MS-DOS (because of maximum command length support)
  • Only limited number of search items are displayed
  • Only limited number of videos in youtube channel are displayed

FAQ:
How fast system is required?
I have tested this on my Pentium 1 system (MS-DOS 6.22) and it can play 144p videos fine and my Pentium 3 system (Windows 98SE) can play 360p videos just fine.

How to solve Out of environment space error ?
Increase environment space, see troubleshooting

Troubleshooting:
If you cannot get videos to play, try following steps:

  • Make sure wget is working. go to wget directory and try to download something:
    cd \youtube\wget\dos\ or cd \youtube\wget\win\
    wget.exe http://sda1.eu/etc/dostube.txt
    type dostube.txt
    It should print "Wget works!" If it doesn't work check your network driver and internet connection
  • Make sure your OS is detected correctly and enviroment variables are set.
    cd \youtube
    config.bat
    scripts\env.bat
    set
    It should print "Detected OS: DOS" or "Detected OS: WIN". You should see "quality", "detected_os" and "wget" in printed environment variables. If they are not set, try increasing environment space: https://www.computerhope.com/issues/ch000325.htm
  • Open Quick view \youtube\qv\qv and try to change options (ALT+O):

Disclaimer
These scripts were made just for fun. No guarantees.

Download
In attachment

Attachments

  • Filename
    dostube.zip
    File size
    4.17 MiB
    Downloads
    276 downloads
    File license
    Fair use/fair dealing exception

Reply 1 of 9, by Falcosoft

User metadata
Rank Oldbie
Rank
Oldbie

Hi,
Thanks for this package. I have tested it under DOS an it works except the player part. Unfortunately with full MS network stack and packet driver loaded qv refuses to start because of low memory.
After a reboot without loading network stack qv plays the downloaded file. Qv also seems to have a problem with proper aspect ratios with 1280x720 videos. The 'Keep video aspect ratio with scaling' in Alt+o options makes it even worse.
So I have used the DOS build of Mplayer instead. It can be configured with its config file to use proper aspect ratio and it can play the videos even with memory constrained situations (full network stack loaded). It also has built-in support for many HD audio devices under DOS (I know qv can also use the PCI.SDR driver). And the best part is it's not shareware 😀. AFAIK this DOS build of mplayer is hard to find so I have uploaded it to my server:
http://falcosoft.hu/mplayer_dos.zip
I could not upload it to Vogons since it is too big (15MB). Maybe it would deserve its place in some Vogons collections.

Website, Facebook, Youtube
Falcosoft Soundfont Midi Player + Munt VSTi + BassMidi VSTi
VST Midi Driver Midi Mapper

Reply 4 of 9, by the3dfxdude

User metadata
Rank Member
Rank
Member

So wget or mplayer would really be all you need for playback. I use mplayer on the command line 99% of the time on linux, so if you get a dos build of it, you are 99% of the way there already.

You shouldn't need wget in dos either, you just need the correct url, if mplayer could interface with the dos packet driver, which maybe it doesn't. mplayer can take urls to mp4 streams and open them itself otherwise. So I suppose wget is used to bridge to getting the files on the net because it can interface with the dos packet driver. I would think adding dos packet driver support to mplayer wouldn't be that hard either.

Now if you were to play youtube, and you don't have the actual mp4 url, then that is where a script like youtube-dl or now yt-dlp comes in. That's where you put in the youtube url, and it returns the actual mp4 stream url that mplayer understands. If there is some "pascal scripts" that do this, sure. But I only know of yt-dlp, which now uses python 3. Maybe getting python running (perhaps version 2?) on dos isn't too bad. But really, you almost don't even need to do this part either.

Also, ffmpeg can playback live streams itself. mplayer is a bit picky about connecting to live streams, but ffmpeg can pipe to mplayer for playback. Seeing that mplayer uses ffmpeg internally, if that builds for dos, then that means ffmpeg may be able to be ported as well, possibly giving even more video support. So I guess, given that you are able to build these programs to dos, that means you should be able to stream current video formats from dos on up. However, I don't remember a dos version per se. I do remember using a version on Windows 9x around 2002, and it worked pretty decently.

Reply 5 of 9, by ise

User metadata
Rank Newbie
Rank
Newbie
the3dfxdude wrote on 2023-04-30, 13:45:

if mplayer could interface with the dos packet driver, which maybe it doesn't.

It does almost from the beginning. Even more, unlike FFmpeg, it was able to stream from a SMB share at the time.

the3dfxdude wrote on 2023-04-30, 13:45:

ffmpeg can pipe to mplayer for playback.

Simultaneously? No. It is impossible due to single-tasking nature of DOS.

the3dfxdude wrote on 2023-04-30, 13:45:

that means ffmpeg may be able to be ported

1 Mar 2007. Later DOS support was added to the upstream and we even had a CI instance among many others for 10 years or so.

Reply 6 of 9, by the3dfxdude

User metadata
Rank Member
Rank
Member
ise wrote on 2023-12-12, 23:46:
the3dfxdude wrote on 2023-04-30, 13:45:

ffmpeg can pipe to mplayer for playback.

Simultaneously? No. It is impossible due to single-tasking nature of DOS.

I was speaking based on pipes in linux. I won't chase down how pipes work on DOS for something like this. However, seeing that ffmpeg can do things to get a video stream over to mplayer, then it's just a matter of leveraging libavcodec or whatever simple glue together logic is needed inside mplayer as a single application, seeing that it's not hard to get ffmpeg and mplayer to work together. It's good to see so late DOS support in the projects, but it's not clear how much modern activity can be done without someone trying further.

Reply 8 of 9, by ise

User metadata
Rank Newbie
Rank
Newbie

That was predictable, youtube regulary changes the API. If a download helper is unaware of these changes, the download speed will be limited at best, but more often the extractor just stops working. Youtube-dl from 2021 is broken too, for example.

the3dfxdude wrote on 2023-12-13, 01:31:

However, seeing that ffmpeg can do things to get a video stream over to mplayer,

I thought the main problem is to get a real url, that will be accessible without speed limits. Solved? Then one can dream of seeking.

Reply 9 of 9, by the3dfxdude

User metadata
Rank Member
Rank
Member
ise wrote on 2023-12-14, 09:55:

That was predictable, youtube regulary changes the API. If a download helper is unaware of these changes, the download speed will be limited at best, but more often the extractor just stops working. Youtube-dl from 2021 is broken too, for example.

the3dfxdude wrote on 2023-12-13, 01:31:

However, seeing that ffmpeg can do things to get a video stream over to mplayer,

I thought the main problem is to get a real url, that will be accessible without speed limits. Solved? Then one can dream of seeking.

That's more of a problem with youtube. But it is certainly solvable, if you want to keep chasing that mouse around. My comment about ffmpeg above was about streaming formats, where things come in separate chunks, like m3u8. ffmpeg can put streams into a format that a video player can use.