Giter Club home page Giter Club logo

videothumb2mpv's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

videothumb2mpv's Issues

[Question] Any way to change the script to use title instead of thumbnail?

Sorry if this isn't exactly the place to put it. I insinctively press the thumbnails to check new videos, and I wanted to know if . I tried editing the script by myself, but it's much better made than what i'm used to and there is no "WHEN #THIS-ID-IS-PRESSED" part that I can edit (i.e I'm to dumb to understand the script)

If there is a way to change the script so I can use the title instead? How should I go into doing that? I'm not looking for the script to accommodate me, telling me what to edit would be more than enough.

Thanks in advance, and thank you so much for the script. I used to have to pull up windows terminal for it, and man did that got tiresome quickly.

Edit 1: Well I'm dumb, re-reading I found that line 24 has the element in question that's used to trigger the "send to mpv" function. Still have no luck replacing it tho, tried ".ytd-compact-video-renderer.style-scope.metadata" but "ytd-thumbnail" just has it's own element name, unlike the "details" part of the thumbnail which is just a div (or I just don't know how to find a workaround). Any help is appreciated.

Edit 2: Ok is 1 in the morning and I've oficially spent too much on this. For anyone's future reference, the JS path that should be changed in line 24 should be "#dismissible > div > div.metadata.style-scope.ytd-compact-video-renderer > a", right here:

image

I'm closing the issue so I don't look more stupid than I look.

Improved Cookie Handling and Video Queueing

You can use this option in mpv.conf to make it so that the cookies are available to the mpv. This way you can watch private videos or mark them as watched. You would also need yt-dlp for this because this option is exclusive to it.

script-opts=ytdl_hook-ytdl_path=/usr/bin/yt-dlp
ytdl-raw-options=cookies-from-browser=firefox,mark-watched=

You can also use umpv script to launch mpv in mpv-url-handler.sh. This way videos will be added to a queue instead of starting a new window every time.
https://github.com/mpv-player/mpv/blob/master/TOOLS/umpv

does not work on macos, but heres how to fix it (and a few additional notes)

  • none of the shell scripts are needed as mpv installs on macos automatically register the mpv:// url handler system wide.
  • only the userscript is needed with the following modification on line 58:
    let newval = "mpv://" + (site.needsFullUrl ? site.url : "") + hrefval;
  • to fix the search bug, and 'most' occurrences of the same bug when navigating around the site, add the following at line 67:
// Wait for the search form to be loaded
var searchForm = document.getElementById("search-form");
if (searchForm) {
    // Add an event listener to the search form
    searchForm.addEventListener("submit", function() {
        // Reload the page when the search form is submitted
        location.reload();
    });
}

// Reload the page whenever the URL in the address bar changes
window.addEventListener("popstate", function() {
    location.reload();
});
  • live streams work just fine.
  • youtube-dl is deprecated. yt-dlp is its successor.
    macos: brew install yt-dlp
    linux: pip install yt-dlp

@updateURL and @downloadURL problems

You should change @updateURL and @downloadurl in userscript.js to a public URL because the current one points to the one only you have access to.
You should change it to this:

// @updateURL https://raw.githubusercontent.com/nsinister/videothumb2mpv/master/userscript.js
// @downloadURL https://raw.githubusercontent.com/nsinister/videothumb2mpv/master/userscript.js

Automatic updating is currently not possible because of incorrect URL.
Here's the pull request to the fix: #2

PS. Great script

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.