Inrixia / Floatplane-Downloader

Project for automatically organizing and downloading Floatplane videos for plex.
https://monitor.spookelton.net/public-dashboards/db0aec66747b4950b01b128916eb737e
GNU Affero General Public License v3.0
152 stars 41 forks source link

[Feature suggestion] Exclude downloads by runtime #135

Closed vodkapmp closed 1 year ago

vodkapmp commented 1 year ago

Would it be possible to have a way to exclude videos from being downloaded based on a maximum runtime?

People might not want to download things like 3+ hour uncut versions of LTT videos, or want to download videos uploaded to Garbage Time, but not the streams.

Inrixia commented 1 year ago

This should be easy to add to the existing sub channel filtering.

Inrixia commented 1 year ago

Should be doable now using the runtimeLessThan and runtimeGreaterThan identifier types.

Please test to confirm it works and close the issue if this is resolved :)

vodkapmp commented 1 year ago

I tested doing:

"identifiers": [
   {
    "check": "1200",
    "type": "runtimeLessThan"
   }
 ],

With the Garbage Time channel, which should've returned 23 videos, but it returned 270 videos. Is my syntax incorrect?

Inrixia commented 1 year ago

Thanks for this. I've been able to identify some flaws in how channel matching and searching etc work.

Using the latest dev build your settings should automatically populate using the new structure and ordered subchannels should work properly now. Let me know if this is stil failing.

vodkapmp commented 1 year ago

It is not happy

Node.js v19.6.0
(node:8) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
file:///fp/dist/subscriptionFetching.js:19
    const channelsToAdd = defaultSubChannels[titleAlias].filter((channel) => sub.channels.findIndex((chan) => chan.title === channel.title) === -1);
                                                         ^

TypeError: Cannot read properties of undefined (reading 'filter')
    at file:///fp/dist/subscriptionFetching.js:19:58
    at Array.map (<anonymous>)
    at fetchSubscriptions (file:///fp/dist/subscriptionFetching.js:5:6)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///fp/dist/float.js:80:27
Inrixia commented 1 year ago

Thanks for catching that. Try again with the latest dev build.

vodkapmp commented 1 year ago

Seems it did now find the videos under 1200s, but now downloads are failing because it can't load Progressbar?

(node:8) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
file:///fp/dist/Downloader.js:40
                throw new Error("Progressbar failed to initialize! Cannot continue download");
                ^

Error: Progressbar failed to initialize! Cannot continue download
    at Downloader.tickQueue (file:///fp/dist/Downloader.js:40:23)
    at Timeout._onTimeout (file:///fp/dist/Downloader.js:47:31)
    at listOnTimeout (node:internal/timers:568:17)
    at process.processTimers (node:internal/timers:511:7)

Node.js v19.6.0
Inrixia commented 1 year ago

Thanks, wait for the latest dev to build and then test this fix please :)

Inrixia commented 1 year ago

Closing for now as this should be fixed. Please re-open if its not

vodkapmp commented 1 year ago

Seems it still isn't fixed :( As soon as I add the runtime check I get the progressbar error and fpdownloader will just exit.

Node.js v19.6.0
(node:8) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
file:///fp/dist/Downloader.js:42
                throw new Error("Progressbar failed to initialize! Cannot continue download");
                ^

Error: Progressbar failed to initialize! Cannot continue download
    at Downloader.tickQueue (file:///fp/dist/Downloader.js:42:23)
    at Timeout._onTimeout (file:///fp/dist/Downloader.js:49:31)
    at listOnTimeout (node:internal/timers:568:17)
    at process.processTimers (node:internal/timers:511:7)

This is the error I get when I add the identifier to Garbage Time. This is specifically what the Garbage Time block looks like:

        "61bc20c9a131fb692bf2a513": {
            "creatorId": "61bc20c9a131fb692bf2a513",
            "plan": "A Years Worth of Garbage",
            "skip": false,
            "channels": [
                {
                    "title": "A Years Worth of Garbage",
                    "skip": false,
                    "identifiers": [
                        {
                            "check": "1200",
                            "type": "runtimeLessThan"
                        }
                    ],
                    "daysToKeepVideos": 1
                }
            ]
        }

If I remove the identifier and just set it to false, there are no issues.

Inrixia commented 1 year ago

Double check your using the latest version. Ill look into it

vodkapmp commented 1 year ago

I am on the latest on the :dev tag yeah, did a force pull just to be sure and the issue still persists.

Inrixia commented 1 year ago

Try with the latest dev now, should be fixed

vodkapmp commented 1 year ago

It does indeed not crash anymore. Sadly it doesn't look like doing runtimeLessThan is working. Doing this:

"identifiers": [
    {
        "check": "1200",
        "type": "runtimeLessThan"
    }
],

Returns every video for the channel, even though it should be returning 25 videos when doing a max 20m search on Floatplane.

I tried to wipe out my subscriptions part of the settings.json to have it be regenerated, but that causes this error:

Node.js v19.7.0
(node:8) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
file:///fp/dist/subscriptionFetching.js:26
    if (settings.subscriptions[subscription.creator].channels.length === 0)
                                                              ^

TypeError: Cannot read properties of undefined (reading 'length')
    at file:///fp/dist/subscriptionFetching.js:26:63
    at Array.map (<anonymous>)
    at fetchSubscriptions (file:///fp/dist/subscriptionFetching.js:5:6)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///fp/dist/float.js:80:27
Inrixia commented 1 year ago

I just tested on the latest dev with both greaterThan and lessThan and it looks like its working correctly.

This for example matches all videos under 5 minutes giving mostly Techquickie:

{
    "title": "test",
    "skip": false,
    "identifiers": [
        {
            "check": "300",
            "type": "runtimeLessThan"
        }
    ]
}

Can you do a clean install using the latest dev and let me know if its working for you now?

note the latest dev has breaking config changes now so you will need to do a proper clean install.

vodkapmp commented 1 year ago

We're all good, it works on latest dev no issues.