Giter Club home page Giter Club logo

Comments (10)

jmbannon avatar jmbannon commented on June 4, 2024 1

There is no simple way out of the box. You could try adding a filter/regex to see if it's audio via inspecting the title or description. Maintaining a separate playlist is probably the best workaround

from ytdl-sub.

jmbannon avatar jmbannon commented on June 4, 2024 1

Good idea @jo-chemla , you could add the following to a preset:

filter_include:
  - "{ %ne( %map_get( entry_metadata, "artist", null ), null ) }"

which means 'only include if entry_metadata (i.e. the info.json) artist field is not equal (ne) to null'

from ytdl-sub.

jmbannon avatar jmbannon commented on June 4, 2024 1

Actually just realized you posted everything I needed. Turns out this bug happens due to some bad design choices when validating subscriptions prior to any execution. #895 should hopefully fix it

from ytdl-sub.

jo-chemla avatar jo-chemla commented on June 4, 2024 1

Thanks a lot for the quick fix! Will test it tonight and report back. Have a good day!

from ytdl-sub.

jo-chemla avatar jo-chemla commented on June 4, 2024 1

Again, thanks, this filter does work indeed with the bugfix! On the yt-dlp thread, someone mentioned this filter "channel~=' - Topic$'" to differentiate between video and audio, but checking artist is way better, almost perfect (some misses, but great anyway).

PS: watched this thread for youtube music metadata parsing: #824

from ytdl-sub.

jmbannon avatar jmbannon commented on June 4, 2024

Still happy to help, closing since this isn't an issue/feature request

from ytdl-sub.

jo-chemla avatar jo-chemla commented on June 4, 2024

Thanks. Started watching this issue thread here yt-dlp/yt-dlp#622 which is probably the best place to get a filter between standard-youtube vs youtube-music file source. Plus, from here yt-dlp/yt-dlp#4217 it seems that the --embed-metadata tag adds artist, title, album metadata, which might be absent from video files metadata, so this could be a discriminator a posteriori between music (pure audio) vs video.

from ytdl-sub.

jo-chemla avatar jo-chemla commented on June 4, 2024

Great idea, trying that. Atm I get this error (running the run_cron script on my docker container, had to use new-line to "escape" the quotes)

ytdl_sub.script.utils.exceptions.FunctionRuntimeException: 
Runtime error occurred when executing the function %map_get: 
'in <string>' requires string as left operand, not String
    = Music: 
      "Youtube-Music-Likes": 
        overrides: 
          subscription_value: "https://www.youtube.com/playlist?list=LL"
        filter_include:
          - >-
            { %ne( %map_get( entry_metadata, "artist", null ), null ) }

Edit: same error when trying to cast to your class of String with the following filter { %ne( %map_get( entry_metadata, %string("artist"), null ), null ) }. Incriminating line:

return Boolean(key in mapping.value)

from ytdl-sub.

jmbannon avatar jmbannon commented on June 4, 2024

Hmm, i think the error implies entry_metadata is a string when it should infact be a map. Let me look into this some more

from ytdl-sub.

jmbannon avatar jmbannon commented on June 4, 2024

Can you send me your full config and subscriptions @jo-chemla

from ytdl-sub.

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.