Giter VIP home page Giter VIP logo

Comments (16)

MintMain21 avatar MintMain21 commented on August 22, 2024 2

Okay, @RafeeDaBoy , first lets get over some basic usage information.

First, you need the youtube-search.lua to be in the scripts folder, alongside scripts like autoload, and ontop-playback. So if those scripts work, then you have the right location.

Second of all, the user-imput.lua and scroll-list.lua both need to be in the script-modules folder. If this doesn't already exist, make it in the same directory where your scripts folder is. It should look something like this:
image

Next, if you want the default behavior to be the YouTube API and Invidious as the backup, then (and make sure you're using a text-editing program for this, as in a coding program. Something like LibreOffice or Word won't be good enough) go to the same area where you typed out your API Key, make sure the default API path is https://www.googleapis.com/youtube/v3/ and then set the fallback Invidious API to https://[insert invidious domain here]//api/v1/. Finally, make sure "use invidious API calls" is set to False, but "fallback Invidious" is set to True.

Any stable Invidious Instance that is publicly available and uses HTTPS for secure connections should work. From my experience, vid.puffyan.us is the most reliable instance.

Bonus: If you leave "URL to load videos from" as the default value, then while Invidious is used to search for YouTube videos, YouTube URLS are what are loaded upon selection. (Think of this like selecting the YouTube icond on the search page below a video). If you want, you can set this to whatever Invidious Instance you prefer, but I find YouTube URLS are easier to share.

As for other MPV Scripts? Well, some of my favorites include Bookmarker-Menu, Easycrop, File-Browser, Pause-Indicator, Playlistmanager, reload, SmartCopyPaste, SponsorBlock_Minimal, and StopCache.

from mpv-scripts.

CogentRedTester avatar CogentRedTester commented on August 22, 2024 2

Thanks a lot for the response. For some reason using the directory where my mpv config and scripts were didn't and putting it in ~AppData\Roaming\mpv data resolved it.

As for the Invidious instance, wouldn't choosing the one with region closest to me be the best option?

You could do this, but I would imagine that the load on the server is more significant than geographic distance. Actually loading videos from that instance might be different, depending on how youtube-dl extracts the url.

As for the bonus part, just to be sure, if I choose an Invidious instance for "URL to load videos from", it's gonna show the video thumbnails?

No, thumbnails are unsupported by this script, and never will be.

One more thing, when I select a channel from the list, instead of showing all the videos of that channel, it just shows a blank screen and plays that channel's latest video after a few minutes. Is that normal?

When you load a channel this script just passes the channel url to mpv, which passes it to youtube-dl. I make no guarantees for how well that works, or what exactly gets added to the playlist, but currently it seems to add all the channel's videos sorted by latest uploaded. If there are a lot of those videos then youtube-dl may take a long time to parse the playlist.

And is there away to have the text of youtube-search show up in front of the mpv logo?

That logo is drawn by the OSC when the player is idle. You can hide it by setting osc-visibility to never. I believe by default the del key cycles this value.

from mpv-scripts.

MintMain21 avatar MintMain21 commented on August 22, 2024 1

Autoplay? That would be a different plugin. https://github.com/cvzi/mpv-youtube-upnext

from mpv-scripts.

CogentRedTester avatar CogentRedTester commented on August 22, 2024 1

Also these issues are really not the place for these discussions, please use the Discussions tab in the future.

from mpv-scripts.

CogentRedTester avatar CogentRedTester commented on August 22, 2024

Do you have a link to the Invidious/Newpipe API documentation?

from mpv-scripts.

CogentRedTester avatar CogentRedTester commented on August 22, 2024

Ok, I believe I have added support for invidious API calls. You need to set the new invidious option to yes. You also have to use the new API_path option to specify a responsive invidious public API. The paths seem to be in the form https://invidiouspath.com/api/v1/. You will probably also want to change the new frontend option, which is the url of the actual site you want to be trying to load the videos from. Set it to the url of whatever invidious frontend you're using.

Edit: changed api_path to API_path

from mpv-scripts.

CogentRedTester avatar CogentRedTester commented on August 22, 2024

This feature is currently in an experimental state, so please let me know about any bugs or strange behaviour. Once you have confirmed it is working we can close the issue.

from mpv-scripts.

MintMain21 avatar MintMain21 commented on August 22, 2024

Well, after toggling the appropriate inputs in the script, I have it set so that it will use an Invidious Instance to search for videos and load the YouTube URLS from those search results. So far so good. Pretty Much exactly how I wanted it.

One additional feature request that I'm going to suggest for quality-of-life purposes is the potential to fallback on another API if the chosen default were to fail (for example, using YouTube API if the Invidious option fails, or using a different Invidious Instance altogether).

Other than that, everything is working. I'll leave you to decide when this issue should be closed. If any bugs pop up I'll keep you updated.

from mpv-scripts.

CogentRedTester avatar CogentRedTester commented on August 22, 2024

Try the latest commit. It should work but is completely untested.

from mpv-scripts.

MintMain21 avatar MintMain21 commented on August 22, 2024

Alright, so to test out the fallback API feature, I left the default as YouTube without an API Key, and set the fallback option to an invidious instance (Use Invidious API Calls is False, Use Invidious for Fallback is true). This didn't work. I tried again by setting both Invidious API and Invidious for Fallback as true, and this did not work either. I tried again by using Invidious for both the default and the fallback (with the defunct invidio.us domain deliberately set as the default), and this time it did work. Finally, I left the default as the defunct invidio.us, but set the fallback to be YouTube using a proper API Key. This does not work.

TL;DR: If both the default and the fallback are Invidious domains, this works fine. Mixing/mingling them with YouTube API however, does not.

I'm not sure if it's plausible to use an Invidious API as a fallback if the default is YouTube nor visa-versa, but if all we want is Invidious Domain fallbacks for Invidious Domain Defaults, then yes, this works.

from mpv-scripts.

CogentRedTester avatar CogentRedTester commented on August 22, 2024

Can you try again now? I believe the last commit should have fixed those issues.

from mpv-scripts.

MintMain21 avatar MintMain21 commented on August 22, 2024

Everything's working now, including the mixing/matching of YouTube and Invidious API.

It might be nice to have multiple layers of fallbacks (so, like, an additional fallback if the default and the first fallback fail), but otherwise this is everything I wanted.

I'll leave you to close it if you feel like you've done enough.

from mpv-scripts.

Rafee-M avatar Rafee-M commented on August 22, 2024

@MintMain21 I was having some problems with setting up YouTube search. I placed the necessary scripts in their respective folders and the API key as well inside the youtube-search.lua file. But press Shift+Y or Ctrl+Y doesn't do anything. Am I missing anything (I wasn't sure which folder to put the script in, so I tried both)? How to implement the mixing/matching of YouTube and Invidious API. Thanks!

P.S I've been trying to perfect mpv and I'd love to know what plugins you're using!

Unstitled

from mpv-scripts.

Rafee-M avatar Rafee-M commented on August 22, 2024

Thanks a lot for the response. For some reason using the directory where my mpv config and scripts were didn't and putting it in ~AppData\Roaming\mpv data resolved it.

As for the Invidious instance, wouldn't choosing the one with region closest to me be the best option?

As for the bonus part, just to be sure, if I choose an Invidious instance for "URL to load videos from", it's gonna show the video thumbnails?

One more thing, when I select a channel from the list, instead of showing all the videos of that channel, it just shows a blank screen and plays that channel's latest video after a few minutes. Is that normal? And is there away to have the text of youtube-search show up in front of the mpv logo?
image
image

from mpv-scripts.

MintMain21 avatar MintMain21 commented on August 22, 2024

You are correct that you should probably use an invidious instance closer to your geographic locaion. As a spoiled US American I personally find vid.puffyan.us to work the best. If another invidious instance works better for you, by all means use it.

Addmitidly, I've never had an issue with text being obscured by the MPV Logo, but both the lack of thumbnails and the default behavior when selecting a channel is normal. Actually, what happens when you select a channel is that it enqueues multiple videos based on recency, so if you use a plugin like Playlist Manager you could easily sift through a channel's recent uploads.

If @CogentRedTester would like to respond, he'd probably be more helpful.

As for me, I admititdly find the MPV plugin most helpful when I'm searching for specific videos. If I need to view video tumbnails or better navigate a channel's content, I either use a Internet Browser + Invidious, or Freetube. In either case, I can easily open videos from there into MPV with SmartCopyPaste.

from mpv-scripts.

Rafee-M avatar Rafee-M commented on August 22, 2024

I already had Playlist Manager and yeah, it shows up there thanks!

Also, is it possible to have a random video play after the current one is done like it does on Invidious's website?

from mpv-scripts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.