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

[FEATURE REQ] Support IRC announces with optional lines #1260

Open
Kuredant opened this issue Nov 16, 2023 · 0 comments
Open

[FEATURE REQ] Support IRC announces with optional lines #1260

Kuredant opened this issue Nov 16, 2023 · 0 comments
Labels
Feature request New features, improvements etc irc

Comments

@Kuredant
Copy link
Contributor

It would be nice to be able to handle IRC announces that have a variable number of lines (e.g. a main announce and an optional freeleech line).
For example, with SugoiMusic, we might have the following announces:

[TV Music] TV Show – Title [TS / MPEG-2 / 1440x1080 / AAC / Japanese / NoSubs] - https://sugoimusic.me/torrents.php?id=000010 / https://sugoimusic.me/torrents.php?action=download&id=000011 - japanese,live Uploaded by: Uploader
FREELEECH - https://sugoimusic.me/torrents.php?id=000010 / https://sugoimusic.me/torrents.php?action=download&id=000011
[Single] Artist – Album Name [FLAC] - https://sugoimusic.me/torrents.php?id=000020 / https://sugoimusic.me/torrents.php?action=download&id=000021 - japanese,pop,female.vocalist Uploaded by: Uploader

The first two lines are for a freeleech torrent, the third is for a non-freeleech torrent.
The second line is optional and only used for freeleech content.

Ideally, we'd be able to do something like this in sugoimusic.yaml:

 parse:
    type: multi
    lines:
      - test:
          - "[Album] Artist – Album Name [FLAC / 2017 / catnumber] - https://sugoimusic.me/torrents.php?id=000010 / https://sugoimusic.me/torrents.php?action=download&id=000011 - japanese,pop,female.vocalist Uploaded by: Uploader 1"
          - "[Single] Artist – Album Name [MP3] - https://sugoimusic.me/torrents.php?id=000020 / https://sugoimusic.me/torrents.php?action=download&id=000021 - japanese,pop,dance Uploaded by: Uploader 2"
          - "[Album] Artist – Album Name [FLAC / 2023 / (+2) / catnumber] - https://sugoimusic.me/torrents.php?id=000030 / https://sugoimusic.me/torrents.php?action=download&id=000031 - japanese Uploaded by: Uploader 3"
          - "[TV Music] TV Show – Title [TS / MPEG-2 / 1920x1080 / AAC / Japanese / NoSubs] - https://sugoimusic.me/torrents.php?id=000040 / https://sugoimusic.me/torrents.php?action=download&id=000041 - japanese,live Uploaded by: Uploader 4"
        pattern: '(\[(.*)\] .*? – .+? \[((?:[^/]+)?(?:(?: \/ )(\d{4}))?(?: \/ [^/]+)*)\]) - (https?://.+/).+id=(\d+) \/ https?://.+action=download&id=(\d+) - (.*) Uploaded by: (.*)'
        vars:
          - torrentName
          - category
          - releaseTags
          - year
          - baseUrl
          - groupId
          - torrentId
          - tags
          - uploader
      - test:
          - "FREELEECH - https://sugoimusic.me/torrents.php?id=000010 / https://sugoimusic.me/torrents.php?action=download&id=000011"
        pattern: '(FREELEECH)?.*'
        optional: true
        vars:
          - freeleech

Currently, using multi here would expect two lines every time and miss some announces.

Related: #1255

@Kuredant Kuredant added the Feature request New features, improvements etc label Nov 16, 2023
@zze0s zze0s added the irc label Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature request New features, improvements etc irc
Projects
None yet
Development

No branches or pull requests

2 participants