1. #1
    Registered User
    Join Date
    February 2004
    Location
    UK
    Posts
    3,257

    Default Forums need an offtopic

    Forums need an offtopic subform imo.

    legit links

    https://www.python.org/
    https://mpv.io/installation/

    for mpv select Windows builds by lachs0r


    This is a little how too that I want to share for those that don't know how to do it.

    How to play youtube videos from the command prompt in windows using mps-youtube.

    Why use mps-youtube?

    Giving that the youtube website is shit, its full of ads and what if you would just like to listen to some music with out the need to play the video? Well I will explain how to do that.

    First you will need to install these packages.

    1. Python
    2. mpv media player (comes as a compressed archive, just extract to c:\mpv)

    Goto the python website and just download the lastest python 3 installer.exe for windows

    run the program and make sure to check the box that says include python in the PATH, it should be the only box unchecked, it will ask if you want to remove file length limits or what ever, click yes.

    After that is installed download mpv player, extract the files to a directory on your main drive, as an example C:\mpv

    Now you might wish to add some stuff to your mpv install, so create a new file called input.conf in c:\mpv\input.conf

    Paste this into it

    Code:
    shift+s         screenshot each-frame
    Shift+UP        seek  600
    Shift+DOWN      seek -600
    =               cycle video-unscaled
    -               cycle-values window-scale 2 3 1 .5
    WHEEL_UP        add volume 5
    WHEEL_DOWN      add volume -5
    WHEEL_LEFT      ignore
    WHEEL_RIGHT     ignore
    Alt+RIGHT       add video-rotate 90
    Alt+LEFT        add video-rotate -90
    Alt+-           add video-zoom -0.25
    Alt+=           add video-zoom 0.25
    Alt+j           add video-pan-x -0.05
    Alt+l           add video-pan-x 0.05
    Alt+i           add video-pan-y 0.05
    Alt+k           add video-pan-y -0.05
    Alt+BS          set video-zoom 0; set video-pan-x 0; set video-pan-y 0
    Those are extra keybinds which do as they imply, mpv is an extremely light player and is very good for low end machines, there is no bloat here, so even high res videos will play smooth on a low end machine mostly, but it just happens to be a very very good player if you learn how to actually use it!

    Default keys I can think of for mpv, space = pause video, key 9 decreases audio volume, key 0 increases audio volume, { and } speed up or slow down video playback, pressing L key will create a start point of a loop, leaving it as is will cause the video when it ends to replay from this location, pressing L again will create the end loop, pressing a L a third time clears the loop.

    So those are installed now it is time to open a cmd prompt in none admin mode, so click windows bottom left corner and type 'cmd' then click the command prompt icon that shows up in the search.

    lists of commands to get everything installed below

    pip install mps-youtube
    pip install youtube-dl
    pip install colorama
    pip install pyperclip

    Allow each command to finish/install and resume to next command from blinking cursor_ or what ever...

    each of these commands will install a python package module and they should automatically be added to PATH

    mps-youtube is the package which will provide the means to search youtube and display the results on command prompt, it is an actual program that uses a player <mpv> it can use mplayer also but just do as I say because I never use that player, mpv is infinitely better.

    youtube-dl short for youtube download is a package which grabs the video from the url, it is constantly updated, its on git hub and open source as is all the others, youtube-dl can also be installed as a seperate program which can be invoked to download videos from most streaming sites from command line.

    colorama provides color for mps-youtube, linux users don't need this if using a terminal that provides color...

    pyperclip allows you to copy and paste links to and from mps-youtube and probably other programs wrote in python for the command line.

    next you will need to start the mps-youtube program and to do that simple type 'mpsyt' and hit enter

    You will be greeted with a display all within the command prompt, next you need to configure it to use mpv and not mplayer as will be the defualt in windows, on linux it will be mpv player. So providing you extracted mpv to 'c:\mpv' simple type this and all the other commands below apart from what is in brackets (), I will explain what each does.

    set player c:\mpv\mpv.com
    set columns date views likes dislikes ytid
    set max-res 192
    set show-video 0
    (will be default no need to set)
    set search-music 1
    (will be default no need to set)

    Set player does as it says, we will use the mpv.com file in windows instead because we are using command prompt, the exe file version causes problems so don't use it!

    Set columns can be looked at more carefully with 'help columns' command, again it set as it says, results will now have their attributes of date first then views and likes, dislikes and finally as I like youtube ID, youtube id lets me copy paste easily into google and find the original page, perhaps i needed the track list or something...

    Set max-res 192 sets the max video or in this case the lowest possible download size, it will do that, it is that good. But the lowest is 192 and not 144, the program will grab the audio stream and now play it using the api/library of mpv to only play the audio. That is to say that mpv won't even open, you will just get the audio playing from the command line and using keys like cursor left or right will skip 10 seconds forwards or backwards, pressing cursor UP or Down will skip 1 minute at a time, using keys 9 and 0 you can change the volume, it works just like a CD player....

    set show-video 0 will allready be set by defualt because that is what this software was essentially made for, to stream music from youtube using the least amount of system resources with out the bullshit, you can set it to 1 and it will invoke mpv player to play the youtube video as is but with out the shit. But you may wish to change the max-res, so say you want 720p? thats easy 'set max-res 720' then followed by 'set show-video 1' the max and lowest can be found by entering a none sane value 'set max-res 9034583045' it will state the limits to you.

    set search-music 1 this sets mps-youtube to only show results of videos on youtube that have been tagged with music, this might filter out some results but who wants to listen to the crude someone uploaded that they cannot even tag correctly? In either case if you have it set to 0 you will encounter actual videos that don't cater to the music lover. But its worth meantioning incase you cannot find what you want with it set to 1.

    Now onto how to use this program properly.

    the 'help command' is very useful, you can just run help to get a list of topics, then you can run 'help topic' for example 'help basics' these commands will tell you how to use the program, from help basics you get another list of topics i believe and you can just delve deeper into the package, just run help on anything... I will not go into the full spectrum of what you can do with this program, there is nothing illegal using it but certain features can violate copy right laws, youtube-dl is a bloody good and effective program in extracting video from many sites for instance. I will just state that if you stream something there is no problems, but if you download it opens a whole can of legal shit, I'm not endorsing such behavour at all, I'm merely providing the means for people to free them selves from all that rat tat crude that is the internet post 2000....

    with that said you can use the 'set order ****' command to sort the results, valid values that I know, date, views, likes etc. It basically uses the youtube algorithm, well it does not it just displays what youtube returns, currently due to the events in NZ youtube have purposely broken filtering so it probably won't work at this time. I do know a way to by pass (simple google dork) that but only in the google search engine, i do not wish to share because they might break that also...

    I'd say people just get to using it and they can learn everything else they need to learn, I love open source software <3 to the devs of this program.

    to uprgrade.

    Always try to upgrade youtube-dl first because google change the site often it will sometimes break, it normally handels slight changes on its own but anyway just do this if something is not working.

    pip install youtube-dl --upgrade

    if that does not work then

    pip install mps-youtube --upgrade

    if nothing works google towards their github and read issues section there are bound to be people with the same problems and some of them offer patches to fix it before the dev team has a chance to fix it them selves.

    Enjoy youtube with out the bullshit, welcome to 90's internet...
    Last edited by LiL T; 28-03-19 at 09:44.

  2. #2
    Registered User
    Join Date
    February 2004
    Location
    UK
    Posts
    3,257

    Default

    To add further, a streaming video cannot be rotated, so don't post that input.conf does not work, you can only change gamma, brightest etc. With a streaming video, the keys are typically the number keys, so just press them, I don't remember them off the top off my head i just press them, 2 sets of keys are for brightness, 2 sets are for gamma, and same for constrast or saturation.

  3. #3
    Registered User
    Join Date
    February 2004
    Location
    UK
    Posts
    3,257

    Default

    Attachment 12820

    An eample and I forgot to state that to search you do this...

    /search term

    so my example was

    /chill synthwave

    a fine choice for this game imo, 12 hour lvling and that neocron music can get old fast...

    to play item just enter its number then enter, to move to the next page just type in 'n' and enter, to move backwards its 'p'

    more mpv key commands that popped into my mind are SHIFT + LEFT or RIGHT cursor, will skip video or audo 1 second, that is useful when combined with simple LEFT, RIGHT, UP or DOWN cursor as those skip by 5 seconds or 1 minute, it can mean finding that specific place in a video or track trivial unlike other bullshit comercial or sub par shit like vlc player, wouldn't touch it, its bloat and it lags when faces with high speed user interaction when simply jumping around in a video... I'll tell you why that is, it tries to be more than just a video/audio player, mpv is just an audio or video player, vlc is a piece of shit, you are free to disagree but i've used loads of software some bad some good, cunts that want to bleed people of their data produce shit code, people that want to build something for the exact purpose produce legendary code.
    Last edited by LiL T; 28-03-19 at 10:01.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •