Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scripts for rss auto download #678

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

zoriya
Copy link
Contributor

@zoriya zoriya commented Oct 11, 2023

Description

Allow users to define a script to decide if a rss item should be downloaded or not. If the scripts return the magic code of 80 (and regex match if it is specified), the item will be downloaded.

This PR also specifies a user agent of 'flood' for http requests used to retrieve the rss since some servers sent 403 when no user agent was specified.

Related Issue

Screenshots

Types of changes

  • Breaking change (changes that break backward compatibility of public API or CLI - semver MAJOR)
  • New feature (non-breaking change which adds functionality - semver MINOR)
  • Bug fix (non-breaking change which fixes an issue - semver PATCH)

@trim21
Copy link
Collaborator

trim21 commented Aug 10, 2024

there are several features mixed in this PR, would you mind split them?

@zoriya
Copy link
Contributor Author

zoriya commented Aug 10, 2024

You want one PR for the script & one for the header?

@trim21
Copy link
Collaborator

trim21 commented Aug 10, 2024

there are also nix file and editor config file

@trim21
Copy link
Collaborator

trim21 commented Aug 10, 2024

You want one PR for the script & one for the header?

yes

  1. you can set miniget options with feedsub directly, there is no need to import miniget.
  2. I don't know nix, I can just merge nix file, if you submit it in a seprated PR.
  3. empty editorconfig doesn't make sense, please add some meanful content, if you want to submit it.

@zoriya
Copy link
Contributor Author

zoriya commented Aug 10, 2024

I removed the nix & editorconfig files, there was no need to push them mb.

I created a PR for the user agent #779

server/util/feedUtil.ts Outdated Show resolved Hide resolved
@zoriya zoriya force-pushed the master branch 3 times, most recently from 5cce493 to 9339748 Compare August 10, 2024 16:27
@trim21
Copy link
Collaborator

trim21 commented Aug 10, 2024

can you add some example for potential users of this feature?

@zoriya
Copy link
Contributor Author

zoriya commented Aug 10, 2024

Sure, where do you want me to place this example?

I'm using the following script to download every item in the rss that has the same name as one of the existing folders:

#!/usr/bin/env bash
set -e

# Retrive name from rss title ($1) & remove special chars
name=$(guessit "$1" -P "title" | tr -d "[:punct:]")

# Check if we should download the item (if not grep will return 1)
ls /mnt/kyoo/shows/ | tr -d "[:punct:]" | grep -qix "$name"

echo "Downloading $1"
exit 80

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants