Git Product home page Git Product logo

moonplayer-plugins's Introduction

moonplayer-plugins's People

Contributors

coslyk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

moonplayer-plugins's Issues

Odysee plugin

Hello there. I would like to have a plugin for the video streaming platform Odysee, but I have no practical experience with JavaScript and especially not with JS regular expressions. Could you please either help me understand what to do, or make a plugin for this? I think modifying the iqiyi plugin will be the best option as it is the simplest (though I think only 1 while loop is needed for Odysee).

Here's some info I have about Odysee:

  1. Search URL: https://odysee.com/$/top?name=searchterm
  2. Tag containing target URL and title: <a href="/@channel:5/searchterm:b"><div class="claim-preview__title"><span title="Title String"...
  3. URL of example video (doesn't exist): https://odysee.com/@channel:5/searchterm:b

In the above snippet, /@channel:5/searchterm:b has the channel name and the search term, and both 5 and b (must be a single character each) has some significance that I'm not aware of but is important nonetheless.

I think I could figure out how to make the extension if I knew how to make the regexp to parse that tag.

Here's the code I have (practically a copy of the iqiyi.js file):

var website_name = 'Odysee';

function search(key, page) {
    var url = 'https://odysee.com/$/top?name=' + key;
    moonplayer.get_content(url, function(content) {
        var result = list_links(content, "https://odysee.com/");
        moonplayer.show_result(result);
    });
}

function list_links(content, prefix) {
    var rex = /<a\s.*?href="\/@.+?">.*?title="(.+?)"/g;
    var match;
    var result = [];
    var urls = []

    while ((match = rex.exec(content)) !== null) {
        if (match[1].startsWith(prefix) && !urls.includes(match[1])) {
            urls.push(match[1]);
            result.push({ title: match[2], url: match[1] });
        }
    }
    
    return result;
}

some keyerror in console

the moonplayer is really cool~
as cool as moon.

Traceback (most recent call last):
  File "~/.moonplayer/plugins/res_sohu_tv.py", line 44, in explore_cb
    data = json.loads(page)['data']
KeyError: 'data'
Traceback (most recent call last):
  File "~/.moonplayer/plugins/res_sohu_tv.py", line 44, in explore_cb
    data = json.loads(page)['data']
KeyError: 'data'

插件已经安装并更新,但是我的搜索网络资源那里是空白

不知道是不是缺了什么东西?系统是elementary OS 5.0 Juno
如图:

终端好像也没有报错

Detected OpenGL backend: vaapi-egl
QApplication: invalid style override passed, ignoring it.
Initialize settings...
Initialize API for Python...
Initialize language support...
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
Initialize mpv backend...
Initialize playlist...
Initialize ResLibrary...
Initialize downloader...
OpenGL Version: 2.1
[cplayer] Warning: option --hwdec-preload was replaced with --opengl-hwdec-interop and might be removed in the future.
libEGL warning: FIXME: egl/x11 doesn't support front buffer rendering.
Remote debugging server started successfully. Try pointing a Chromium-based browser to http://127.0.0.1:19260

can't use the plugins

as long as I put the plugins(sohu,bilibili) into the pluins folder,the player wouldn't be open

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.