Comments (16)
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:
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.
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.
Autoplay? That would be a different plugin. https://github.com/cvzi/mpv-youtube-upnext
from mpv-scripts.
Also these issues are really not the place for these discussions, please use the Discussions tab in the future.
from mpv-scripts.
Do you have a link to the Invidious/Newpipe API documentation?
from mpv-scripts.
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.
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.
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.
Try the latest commit. It should work but is completely untested.
from mpv-scripts.
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.
Can you try again now? I believe the last commit should have fixed those issues.
from mpv-scripts.
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.
@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!
from mpv-scripts.
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?
from mpv-scripts.
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.
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)
- All the ' are displayed as ' when searching HOT 4
- youtube-search: youtube API does not accept search HOT 22
- youtube-search: ctrl+i breaks searching. HOT 2
- Documentation: Unclear on how to set it up HOT 3
- youtube-search: Update Description in README.md
- Add it mplug script directory
- `command-timeout.lua`: `screenshot` command doesn't print any OSD message HOT 3
- youtube-search: curl not returning search list HOT 3
- youtube-search.lua: Use yt-dlp instead of curl+API HOT 3
- keep-session.lua: "auto_load" resize mpv window although mpv.conf "auto-window-resize=no" HOT 2
- keep-session: add an option to remeber only the last opened video, not the playlist HOT 6
- script-name: keep-session.lua HOT 1
- [cycle-profile] How to restore default profile? HOT 10
- [profile-command.lua] How to use? HOT 11
- Youtube-search: Need help to change the keybind in input.conf HOT 1
- youtube-search: doesn't work with the newest version of mpv (0.38) HOT 1
- [Feature Request] Exclude folders in keep-session.lua
- README: please add screenshots / animations for better understanding of a script HOT 1
- How to specify no-osd with the new syntax of the Cycle-commands plugin? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mpv-scripts.