moc + YT

MOC version: 
1:2.6.0~svn-r3005-3

Hi, this ist (I belelive) my first post here ;-)

Thanks for moc. I use it since Years. I like the concept, its funcionality, it's small amount of recoures it uses. And last but not least it is really easy to use an mostly self-explanatory.

I found a posting which explains how to (possibly) circumvent the missing capability of playing YT files (the audio part)

Is there an extension or something for MOC so that it can stream/play the audio parts of youtube videos.

Not Specificly... But Maybe
Not specificly, and nor am I planning on adding it. But setting the
YouTube video MIME type to point at the FFmpeg decoder and playing
the URL might work.

See the 'PreferredDecoders' configuration option and you'll need MOC
built from the current SVN.

Also see: http://moc.daper.net/node/823

Let us know if that works for you.

How can I change the YT video MIME type?

BTW: I am using ytfzf (on Debian/sid(uction)) for playing YT audio. But as ytfzf is bare CL, not ncurses like moc, it's a PITA. That's why I am interested in a way to use moc for YT. A plugin which pipes ytfzf search results to a moc playlist would be great.

Anyway ... thanks

Why not ask this question in the original thread? For reference, it's: https://moc.daper.net/node/834.

I strongly doubt that this solution could work. As far as I know ffmpeg itself can't handle Youtube. Can't think of any simple solution to make MOC work with Youtube.

The idea was to set
PreferredDecoders += SOMETHING(ffmpeg)
in MOC config, where SOMETHIN would be mime type of Youtube data (like video/mp4 or something similar). However you would need to be able to get a link to raw video stream from Youtube and I don't think it is possible.

Thanks for your answer.

I found the original thread using google, but as it was rather old (2012) I wasn't sure I should make it resurrect. Next time ...

So if *you* doubt there's a simple solution to make MOC work with Youtube that's discouraging. But again, if ytfzf (open source) is able to play YT, can't you have a look and borrow some code or ideas, or harvest links from ytfzf search results?

ytfzf is too much a PITA and moc is to good a player to not to *wish* for a way to interconnect both with each other.

Anyway ... thanks again for your answer and whatever you ar contributing.

Well, yt-dlp (which the software doing all work in ytfzf) is written in Python and it might be possible to write MOC decoder plugin utilizing it. I'm afraid it is not a very straightforward thing to do. Moreover it would be rather limited in functionality due to the nature of MOC. You would have to make a playlist of Youtube urls.

From my point of view it seems much easier and convenient just to download audio part of the tracks and store it locally.

BTW: I am using ytfzf (on Debian/sid(uction)) for playing YT audio. But as ytfzf is bare CL, not ncurses like moc, it's a PITA. That's why I am interested in a way to use moc for YT. A plugin which pipes ytfzf search results to a moc playlist would be great.

That's an idea, but I have no knowledge of ytfzf. It seems to me that it's more of a case that ytfzf could have a capability to emit an M3U playlist or there be a utility to convert whatever format it does save in (if any) to M3U.

But I agree with user tomaszg that one probably cannot isolate the audio alone for download (but I haven't checked) and the overhead of having to download the video component as well would likely result in unacceptably stuttery playback.

That's where ytfzf comes from (but I installed from Debian!):

https://github.com/pystardust/ytfzf

It seems there are various audio-only options:
https://github.com/pystardust/ytfzf/wiki/ytfzf(1)

As ytfzf seems to use ytdl for D/L, and as there is an option for audio only, there has to be an option to retrieve an URL for a bare audio file which -may be- a moc plugin could pic up?

thanks for chiming in ... and your work!