feat(releases): add info url link to releases list (#683)

* feat(indexers): definitions add infourl to irc parsing

* feat(indexers): add infourl to releases

* fix(indexers): fix info urls

* fix(indexers): update btn
This commit is contained in:
ze0s 2023-01-29 21:40:49 +01:00 committed by GitHub
parent 870e109f6c
commit 4c83787a0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
68 changed files with 189 additions and 13 deletions

View file

@ -223,6 +223,10 @@ func (a *announceProcessor) onLinesMatched(def *domain.IndexerDefinition, vars m
if matched != nil { if matched != nil {
rls.TorrentURL = matched.TorrentURL rls.TorrentURL = matched.TorrentURL
if matched.InfoURL != "" {
rls.InfoURL = matched.InfoURL
}
// only used by few indexers // only used by few indexers
if matched.TorrentName != "" { if matched.TorrentName != "" {
rls.TorrentName = matched.TorrentName rls.TorrentName = matched.TorrentName

View file

@ -199,6 +199,8 @@ CREATE TABLE "release"
protocol TEXT, protocol TEXT,
implementation TEXT, implementation TEXT,
timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP, timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
info_url TEXT,
download_url TEXT,
group_id TEXT, group_id TEXT,
torrent_id TEXT, torrent_id TEXT,
torrent_name TEXT, torrent_name TEXT,
@ -647,4 +649,10 @@ UPDATE release_action_status
SET filter_id = (SELECT f.id SET filter_id = (SELECT f.id
FROM filter f WHERE f.name = release_action_status.filter); FROM filter f WHERE f.name = release_action_status.filter);
`, `,
`ALTER TABLE "release"
ADD COLUMN info_url TEXT;
ALTER TABLE "release"
ADD COLUMN download_url TEXT;
`,
} }

View file

@ -35,8 +35,8 @@ func (repo *ReleaseRepo) Store(ctx context.Context, r *domain.Release) (*domain.
queryBuilder := repo.db.squirrel. queryBuilder := repo.db.squirrel.
Insert("release"). Insert("release").
Columns("filter_status", "rejections", "indexer", "filter", "protocol", "implementation", "timestamp", "group_id", "torrent_id", "torrent_name", "size", "title", "category", "season", "episode", "year", "resolution", "source", "codec", "container", "hdr", "release_group", "proper", "repack", "website", "type", "origin", "tags", "uploader", "pre_time", "filter_id"). Columns("filter_status", "rejections", "indexer", "filter", "protocol", "implementation", "timestamp", "group_id", "torrent_id", "info_url", "download_url", "torrent_name", "size", "title", "category", "season", "episode", "year", "resolution", "source", "codec", "container", "hdr", "release_group", "proper", "repack", "website", "type", "origin", "tags", "uploader", "pre_time", "filter_id").
Values(r.FilterStatus, pq.Array(r.Rejections), r.Indexer, r.FilterName, r.Protocol, r.Implementation, r.Timestamp.Format(time.RFC3339), r.GroupID, r.TorrentID, r.TorrentName, r.Size, r.Title, r.Category, r.Season, r.Episode, r.Year, r.Resolution, r.Source, codecStr, r.Container, hdrStr, r.Group, r.Proper, r.Repack, r.Website, r.Type, r.Origin, pq.Array(r.Tags), r.Uploader, r.PreTime, r.FilterID). Values(r.FilterStatus, pq.Array(r.Rejections), r.Indexer, r.FilterName, r.Protocol, r.Implementation, r.Timestamp.Format(time.RFC3339), r.GroupID, r.TorrentID, r.InfoURL, r.TorrentURL, r.TorrentName, r.Size, r.Title, r.Category, r.Season, r.Episode, r.Year, r.Resolution, r.Source, codecStr, r.Container, hdrStr, r.Group, r.Proper, r.Repack, r.Website, r.Type, r.Origin, pq.Array(r.Tags), r.Uploader, r.PreTime, r.FilterID).
Suffix("RETURNING id").RunWith(repo.db.handler) Suffix("RETURNING id").RunWith(repo.db.handler)
// return values // return values
@ -205,7 +205,7 @@ func (repo *ReleaseRepo) findReleases(ctx context.Context, tx *Tx, params domain
} }
queryBuilder := repo.db.squirrel. queryBuilder := repo.db.squirrel.
Select("r.id", "r.filter_status", "r.rejections", "r.indexer", "r.filter", "r.protocol", "r.title", "r.torrent_name", "r.size", "r.timestamp", Select("r.id", "r.filter_status", "r.rejections", "r.indexer", "r.filter", "r.protocol", "r.info_url", "r.download_url", "r.title", "r.torrent_name", "r.size", "r.timestamp",
"ras.id", "ras.status", "ras.action", "ras.type", "ras.client", "ras.filter", "ras.rejections", "ras.timestamp"). "ras.id", "ras.status", "ras.action", "ras.type", "ras.client", "ras.filter", "ras.rejections", "ras.timestamp").
Column(sq.Alias(countQuery, "page_total")). Column(sq.Alias(countQuery, "page_total")).
From("release r"). From("release r").
@ -239,14 +239,14 @@ func (repo *ReleaseRepo) findReleases(ctx context.Context, tx *Tx, params domain
var rls domain.Release var rls domain.Release
var ras domain.ReleaseActionStatus var ras domain.ReleaseActionStatus
var rlsindexer, rlsfilter sql.NullString var rlsindexer, rlsfilter, infoUrl, downloadUrl sql.NullString
var rasId sql.NullInt64 var rasId sql.NullInt64
var rasStatus, rasAction, rasType, rasClient, rasFilter sql.NullString var rasStatus, rasAction, rasType, rasClient, rasFilter sql.NullString
var rasRejections []sql.NullString var rasRejections []sql.NullString
var rasTimestamp sql.NullTime var rasTimestamp sql.NullTime
if err := rows.Scan(&rls.ID, &rls.FilterStatus, pq.Array(&rls.Rejections), &rlsindexer, &rlsfilter, &rls.Protocol, &rls.Title, &rls.TorrentName, &rls.Size, &rls.Timestamp, &rasId, &rasStatus, &rasAction, &rasType, &rasClient, &rasFilter, pq.Array(&rasRejections), &rasTimestamp, &countItems); err != nil { if err := rows.Scan(&rls.ID, &rls.FilterStatus, pq.Array(&rls.Rejections), &rlsindexer, &rlsfilter, &rls.Protocol, &infoUrl, &downloadUrl, &rls.Title, &rls.TorrentName, &rls.Size, &rls.Timestamp, &rasId, &rasStatus, &rasAction, &rasType, &rasClient, &rasFilter, pq.Array(&rasRejections), &rasTimestamp, &countItems); err != nil {
return res, 0, 0, errors.Wrap(err, "error scanning row") return res, 0, 0, errors.Wrap(err, "error scanning row")
} }
@ -280,6 +280,8 @@ func (repo *ReleaseRepo) findReleases(ctx context.Context, tx *Tx, params domain
rls.Indexer = rlsindexer.String rls.Indexer = rlsindexer.String
rls.FilterName = rlsfilter.String rls.FilterName = rlsfilter.String
rls.ActionStatus = make([]domain.ReleaseActionStatus, 0) rls.ActionStatus = make([]domain.ReleaseActionStatus, 0)
rls.InfoURL = infoUrl.String
rls.TorrentURL = downloadUrl.String
// only add ActionStatus if it's not empty // only add ActionStatus if it's not empty
if ras.ID > 0 { if ras.ID > 0 {

View file

@ -199,6 +199,8 @@ CREATE TABLE "release"
protocol TEXT, protocol TEXT,
implementation TEXT, implementation TEXT,
timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP, timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
info_url TEXT,
download_url TEXT,
group_id TEXT, group_id TEXT,
torrent_id TEXT, torrent_id TEXT,
torrent_name TEXT, torrent_name TEXT,
@ -1040,4 +1042,10 @@ UPDATE release_action_status
SET filter_id = (SELECT f.id SET filter_id = (SELECT f.id
FROM filter f WHERE f.name = release_action_status.filter); FROM filter f WHERE f.name = release_action_status.filter);
`, `,
`ALTER TABLE "release"
ADD COLUMN info_url TEXT;
ALTER TABLE "release"
ADD COLUMN download_url TEXT;
`,
} }

View file

@ -178,10 +178,12 @@ type IndexerIRCParseLine struct {
type IndexerIRCParseMatch struct { type IndexerIRCParseMatch struct {
TorrentURL string `json:"torrenturl"` TorrentURL string `json:"torrenturl"`
TorrentName string `json:"torrentname"` TorrentName string `json:"torrentname"`
InfoURL string `json:"infourl"`
Encode []string `json:"encode"` Encode []string `json:"encode"`
} }
type IndexerIRCParseMatched struct { type IndexerIRCParseMatched struct {
InfoURL string
TorrentURL string TorrentURL string
TorrentName string TorrentName string
} }
@ -198,6 +200,45 @@ func (p *IndexerIRCParse) ParseMatch(baseURL string, vars map[string]string) (*I
} }
} }
if p.Match.InfoURL != "" {
// setup text template to inject variables into
tmpl, err := template.New("infourl").Funcs(sprig.TxtFuncMap()).Parse(p.Match.InfoURL)
if err != nil {
return nil, errors.New("could not create info url template")
}
var urlBytes bytes.Buffer
if err := tmpl.Execute(&urlBytes, &vars); err != nil {
return nil, errors.New("could not write info url template output")
}
templateUrl := urlBytes.String()
parsedUrl, err := url.Parse(templateUrl)
if err != nil {
return nil, err
}
// for backwards compatibility remove Host and Scheme to rebuild url
if parsedUrl.Host != "" {
parsedUrl.Host = ""
}
if parsedUrl.Scheme != "" {
parsedUrl.Scheme = ""
}
// join baseURL with query
baseUrlPath, err := url.JoinPath(baseURL, parsedUrl.Path)
if err != nil {
return nil, errors.Wrap(err, "could not join info url")
}
// reconstruct url
infoUrl, _ := url.Parse(baseUrlPath)
infoUrl.RawQuery = parsedUrl.RawQuery
matched.InfoURL = infoUrl.String()
}
if p.Match.TorrentURL != "" { if p.Match.TorrentURL != "" {
// setup text template to inject variables into // setup text template to inject variables into
tmpl, err := template.New("torrenturl").Funcs(sprig.TxtFuncMap()).Parse(p.Match.TorrentURL) tmpl, err := template.New("torrenturl").Funcs(sprig.TxtFuncMap()).Parse(p.Match.TorrentURL)

View file

@ -44,9 +44,10 @@ type Release struct {
Protocol ReleaseProtocol `json:"protocol"` Protocol ReleaseProtocol `json:"protocol"`
Implementation ReleaseImplementation `json:"implementation"` // irc, rss, api Implementation ReleaseImplementation `json:"implementation"` // irc, rss, api
Timestamp time.Time `json:"timestamp"` Timestamp time.Time `json:"timestamp"`
InfoURL string `json:"info_url"`
TorrentURL string `json:"download_url"`
GroupID string `json:"group_id"` GroupID string `json:"group_id"`
TorrentID string `json:"torrent_id"` TorrentID string `json:"torrent_id"`
TorrentURL string `json:"-"`
TorrentTmpFile string `json:"-"` TorrentTmpFile string `json:"-"`
TorrentDataRawBytes []byte `json:"-"` TorrentDataRawBytes []byte `json:"-"`
TorrentHash string `json:"-"` TorrentHash string `json:"-"`

View file

@ -72,4 +72,5 @@ irc:
- torrentId - torrentId
match: match:
infourl: "/details.php?id={{ .torrentId }}"
torrenturl: "/rssdownload.php?passkey={{ .passkey }}&uid={{ .uid }}&tid={{ .torrentId }}" torrenturl: "/rssdownload.php?passkey={{ .passkey }}&uid={{ .uid }}&tid={{ .torrentId }}"

View file

@ -62,4 +62,5 @@ irc:
- torrentId - torrentId
match: match:
infourl: "/torrents/{{ .torrentId }}"
torrenturl: "/torrent/download/{{ .torrentId }}.{{ .rsskey }}" torrenturl: "/torrent/download/{{ .torrentId }}.{{ .rsskey }}"

View file

@ -83,4 +83,5 @@ irc:
- auto - auto
match: match:
infourl: "/torrents.php?id={{ .torrentId }}"
torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&authkey={{ .authkey }}&torrent_pass={{ .torrent_pass }}" torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&authkey={{ .authkey }}&torrent_pass={{ .torrent_pass }}"

View file

@ -67,7 +67,7 @@ irc:
- "Best Visual Novel - Visual Novel [2006] :: Game / PC / Unarchived / Hentai (Censored) || https://animebytes.tv/torrents.php?id=00000&torrentid=00000 || nukige || Uploaded by: Uploader" - "Best Visual Novel - Visual Novel [2006] :: Game / PC / Unarchived / Hentai (Censored) || https://animebytes.tv/torrents.php?id=00000&torrentid=00000 || nukige || Uploaded by: Uploader"
- "Artist Name - Album of awesome Music [1991] :: MP3 / V0 (VBR) / CD || https://animebytes.tv/torrents2.php?id=00000&torrentid=000000 || ambient, folk || Uploaded by: Uploader" - "Artist Name - Album of awesome Music [1991] :: MP3 / V0 (VBR) / CD || https://animebytes.tv/torrents2.php?id=00000&torrentid=000000 || ambient, folk || Uploaded by: Uploader"
- "Awesome Series - TV Series [2022] :: Web / MKV / h264 / 1080p / AAC 2.0 / Softsubs (Sub Group) / Episode 1 / Freeleech || https://animebytes.tv/torrents.php?id=00000&torrentid=000000 || || Uploaded by: Uploader" - "Awesome Series - TV Series [2022] :: Web / MKV / h264 / 1080p / AAC 2.0 / Softsubs (Sub Group) / Episode 1 / Freeleech || https://animebytes.tv/torrents.php?id=00000&torrentid=000000 || || Uploaded by: Uploader"
pattern: '((.*?)+)(?: - )?(Visual Novel|Light Novel|TV S.*|Movie|Manga|OVA|ONA|DVD Special|BD Special|Oneshot|Anthology|Manhwa|Manhua|Artbook|Game|Live Action.*|)[\s\p{Zs}]{2,}\[(\d+)\] :: (.*?(?:Hardsubs|RAW|Softsubs|Translated) \((.*?)\).*?|.*?)(?: \/ Episode (\d+).*?)?(?: \/ )?(Freeleech)?(?:.?\|\|.?)(https.+\/)torrents.*\?id=\d+&torrentid=(\d+)(?:.?\|\|.?)?([A-Za-z,. ]+\w)?(?:.?\|\|.?)?(?:Uploaded by: (.*))?' pattern: '((.*?)+)(?: - )?(Visual Novel|Light Novel|TV S.*|Movie|Manga|OVA|ONA|DVD Special|BD Special|Oneshot|Anthology|Manhwa|Manhua|Artbook|Game|Live Action.*|)[\s\p{Zs}]{2,}\[(\d+)\] :: (.*?(?:Hardsubs|RAW|Softsubs|Translated) \((.*?)\).*?|.*?)(?: \/ Episode (\d+).*?)?(?: \/ )?(Freeleech)?(?:.?\|\|.?)(https.+\/)torrents.*\?id=(\d+)&torrentid=(\d+)(?:.?\|\|.?)?([A-Za-z,. ]+\w)?(?:.?\|\|.?)?(?:Uploaded by: (.*))?'
vars: vars:
- torrentName - torrentName
- title - title
@ -78,10 +78,12 @@ irc:
- releaseEpisode - releaseEpisode
- freeleech - freeleech
- baseUrl - baseUrl
- groupId
- torrentId - torrentId
- tags - tags
- uploader - uploader
match: match:
infourl: "/torrents.php?id={{ .groupId }}&torrentid={{ .torrentId }}"
torrenturl: "/torrent/{{ .torrentId }}/download/{{ .passkey }}" torrenturl: "/torrent/{{ .torrentId }}/download/{{ .passkey }}"
torrentname: "{{ if .releaseGroup }}[{{ .releaseGroup }}] {{ end }}{{ .torrentName }} {{ if .releaseEpisode }}{{ printf \"- %02s \" .releaseEpisode }}{{ end }} {{ if .year }}[{{ .year }}]{{ end }}{{ print \"[\" .releaseTags \"]\" | replace \" / \" \"][\" }}" torrentname: "{{ if .releaseGroup }}[{{ .releaseGroup }}] {{ end }}{{ .torrentName }} {{ if .releaseEpisode }}{{ printf \"- %02s \" .releaseEpisode }}{{ end }} {{ if .year }}[{{ .year }}]{{ end }}{{ print \"[\" .releaseTags \"]\" | replace \" / \" \"][\" }}"

View file

@ -74,4 +74,5 @@ irc:
- tags - tags
match: match:
infourl: "/torrents.php?id={{ .torrentId }}"
torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&torrent_pass={{ .torrent_pass }}" torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&torrent_pass={{ .torrent_pass }}"

View file

@ -59,7 +59,7 @@ irc:
type: single type: single
lines: lines:
- test: - test:
- "New Torrent: That.Show.S01.1080p.Blu-ray.AVC.DTS-HD.MA.5.1-Test Category: TV By: Uploader Size: 137.73 GB Link: https://beyond-hd.me/details.php?id=00000" - "New Torrent: That.Show.S01.1080p.Blu-ray.AVC.DTS-HD.MA.5.1-Test Category: TV By: Uploader Size: 137.73 GB Link: https://beyond-hd.me/torrents/autodl?id=00000"
pattern: 'New Torrent: (.*) Category: (.*) By: (.*) Size: (.*) Link: (https?\:\/\/[^\/]+\/).*[&\?]id=(\d+)' pattern: 'New Torrent: (.*) Category: (.*) By: (.*) Size: (.*) Link: (https?\:\/\/[^\/]+\/).*[&\?]id=(\d+)'
vars: vars:
- torrentName - torrentName
@ -70,4 +70,5 @@ irc:
- torrentId - torrentId
match: match:
infourl: "/torrents/autodl?id={{ .torrentId }}"
torrenturl: "/torrent/download/auto.{{ .torrentId }}.{{ .rsskey }}" torrenturl: "/torrent/download/auto.{{ .torrentId }}.{{ .rsskey }}"

View file

@ -63,4 +63,5 @@ irc:
- torrentId - torrentId
match: match:
infourl: "/details.php?id={{ .torrentId }}"
torrenturl: "/rssdownload.php?id={{ .torrentId }}&passkey={{ .passkey }}" torrenturl: "/rssdownload.php?id={{ .torrentId }}&passkey={{ .passkey }}"

View file

@ -62,4 +62,5 @@ irc:
- preTime - preTime
match: match:
infourl: "/details.php?id={{ .torrentId }}"
torrenturl: "/download.php?torrent={{ .torrentId }}&torrent_pass={{ .passkey }}" torrenturl: "/download.php?torrent={{ .torrentId }}&torrent_pass={{ .passkey }}"

View file

@ -64,4 +64,5 @@ irc:
- torrentId - torrentId
match: match:
infourl: "/details.php?id={{ .torrentId }}"
torrenturl: "/download.php?torrent={{ .torrentId }}&k={{ .rsskey }}&ssl=1" torrenturl: "/download.php?torrent={{ .torrentId }}&k={{ .rsskey }}&ssl=1"

View file

@ -96,10 +96,12 @@ irc:
- preTime - preTime
- test: - test:
- "[ https://XXXXXXXXX/torrents.php?id=7338 / https://XXXXXXXXX/torrents.php?action=download&id=9116 ]" - "[ https://XXXXXXXXX/torrents.php?id=7338 / https://XXXXXXXXX/torrents.php?action=download&id=9116 ]"
pattern: \[ .* \/ (https?:\/\/.*\/).+id=(\d+) \] pattern: \[ (https?:\/\/.*\/).+id=(\d+) \/ https?:\/\/.*\/.+id=(\d+) \]
vars: vars:
- baseUrl - baseUrl
- groupId
- torrentId - torrentId
match: match:
infourl: "/torrents.php?id={{ .groupId }}&torrentid={{ .torrentId }}"
torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&authkey={{ .authkey }}&torrent_pass={{ .torrent_pass }}" torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&authkey={{ .authkey }}&torrent_pass={{ .torrent_pass }}"

View file

@ -68,4 +68,5 @@ irc:
- torrentId - torrentId
match: match:
infourl: "/torrents.php?id={{ .torrentId }}"
torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&authkey={{ .authkey }}&torrent_pass={{ .torrent_pass }}" torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&authkey={{ .authkey }}&torrent_pass={{ .torrent_pass }}"

View file

@ -72,4 +72,5 @@ irc:
- freeleech - freeleech
match: match:
infourl: "/torrents/{{ .torrentId }}"
torrenturl: "/torrent/download/{{ .torrentId }}.{{ .passkey }}" torrenturl: "/torrent/download/{{ .torrentId }}.{{ .passkey }}"

View file

@ -67,4 +67,5 @@ irc:
- torrentId - torrentId
match: match:
infourl: "/torrent/{{ .torrentId }}"
torrenturl: "/api/v1/torrents/download/{{ .torrentId }}/{{ .passkey }}" torrenturl: "/api/v1/torrents/download/{{ .torrentId }}/{{ .passkey }}"

View file

@ -61,4 +61,5 @@ irc:
- preTime - preTime
match: match:
infourl: "/details.php?id={{ .torrentId }}"
torrenturl: "/download.php?torrent={{ .torrentId }}&torrent_pass={{ .passkey }}" torrenturl: "/download.php?torrent={{ .torrentId }}&torrent_pass={{ .passkey }}"

View file

@ -69,4 +69,5 @@ irc:
- torrentId - torrentId
match: match:
infourl: "/torrents.php?torrentid={{ .torrentId }}"
torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&authkey={{ .authkey }}&torrent_pass={{ .torrent_pass }}" torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&authkey={{ .authkey }}&torrent_pass={{ .torrent_pass }}"

View file

@ -68,4 +68,5 @@ irc:
- torrentId - torrentId
match: match:
infourl: "/torrents.php?id={{ .torrentId }}"
torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&authkey={{ .authkey }}&torrent_pass={{ .torrent_pass }}" torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&authkey={{ .authkey }}&torrent_pass={{ .torrent_pass }}"

View file

@ -66,6 +66,7 @@ irc:
- uploader - uploader
match: match:
infourl: "/details.php?id={{ .torrentId }}"
torrenturl: "/download.php?id={{ .torrentId }}&file={{ .torrentName }}.torrent&passkey={{ .passkey }}" torrenturl: "/download.php?id={{ .torrentId }}&file={{ .torrentName }}.torrent&passkey={{ .passkey }}"
encode: encode:
- torrentName - torrentName

View file

@ -74,6 +74,7 @@ irc:
# - preTime # - preTime
match: match:
infourl: "/details.php?id={{ .torrentId }}"
torrenturl: "/download.php/{{ .torrentId }}/{{ .passkey }}/{{ .torrentName }}.torrent" torrenturl: "/download.php/{{ .torrentId }}/{{ .passkey }}/{{ .torrentName }}.torrent"
encode: encode:
- torrentName - torrentName

View file

@ -67,6 +67,7 @@ irc:
- torrentName - torrentName
match: match:
infourl: "/attachment.php?attachmentid={{ .torrentId }}"
torrenturl: "/rss/torrent.php/{{ .torrentId }}/{{ .uid }}/{{ .passkey }}/{{ .torrentName }}.torrent" torrenturl: "/rss/torrent.php/{{ .torrentId }}/{{ .uid }}/{{ .passkey }}/{{ .torrentName }}.torrent"
encode: encode:
- torrentName - torrentName

View file

@ -98,4 +98,5 @@ irc:
- tags - tags
match: match:
infourl: "/torrents.php?torrentid={{ .torrentId }}"
torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&authkey={{ .authkey }}&torrent_pass={{ .torrent_pass }}" torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&authkey={{ .authkey }}&torrent_pass={{ .torrent_pass }}"

View file

@ -63,6 +63,7 @@ irc:
- torrentId - torrentId
match: match:
infourl: "/details.php?id={{ .torrentId }}"
torrenturl: "/download.php?id={{ .torrentId }}&f={{ .torrentName }}.torrent&rsspid={{ .rsskey }}" torrenturl: "/download.php?id={{ .torrentId }}&f={{ .torrentName }}.torrent&rsspid={{ .rsskey }}"
encode: encode:
- torrentName - torrentName

View file

@ -67,6 +67,7 @@ irc:
- torrentId - torrentId
match: match:
infourl: "/details.php?id={{ .torrentId }}"
torrenturl: "/rss/?action=download&key={{ .key }}&token={{ .token }}&hash={{ .torrentId }}&title={{ .torrentName }}" torrenturl: "/rss/?action=download&key={{ .key }}&token={{ .token }}&hash={{ .torrentId }}&title={{ .torrentName }}"
encode: encode:
- torrentName - torrentName

View file

@ -74,4 +74,5 @@ irc:
- torrentId - torrentId
match: match:
infourl: "/details.php?id={{ .torrentId }}"
torrenturl: "/download.php?id={{ .torrentId }}&passkey={{ .passkey }}" torrenturl: "/download.php?id={{ .torrentId }}&passkey={{ .passkey }}"

View file

@ -84,4 +84,5 @@ irc:
- torrentName - torrentName
match: match:
infourl: "/torrents.php?id={{ .torrentId }}"
torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&authkey={{ .authkey }}&torrent_pass={{ .passkey }}" torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&authkey={{ .authkey }}&torrent_pass={{ .passkey }}"

View file

@ -65,4 +65,5 @@ irc:
- uploader - uploader
match: match:
infourl: "/torrents/{{ .torrentId }}"
torrenturl: "/torrent/download/{{ .torrentId }}.{{ .rsskey }}" torrenturl: "/torrent/download/{{ .torrentId }}.{{ .rsskey }}"

View file

@ -71,4 +71,5 @@ irc:
- torrentId - torrentId
match: match:
infourl: "/details.php?id={{ .torrentId }}"
torrenturl: "/download.php?type=rss&secret_key={{ .passkey }}&id={{ .torrentId }}" torrenturl: "/download.php?type=rss&secret_key={{ .passkey }}&id={{ .torrentId }}"

View file

@ -63,4 +63,5 @@ irc:
- uploader - uploader
match: match:
infourl: "/details.php?id={{ .torrentId }}"
torrenturl: "/download2.php?id={{ .torrentId }}&passkey={{ .passkey }}" torrenturl: "/download2.php?id={{ .torrentId }}&passkey={{ .passkey }}"

View file

@ -74,6 +74,7 @@ irc:
- torrentSize - torrentSize
match: match:
infourl: "/details.php?id={{ .torrentId }}"
torrenturl: "/download.php/{{ .torrentId }}/{{ .torrentName }}.torrent?torrent_pass={{ .passkey }}" torrenturl: "/download.php/{{ .torrentId }}/{{ .torrentName }}.torrent?torrent_pass={{ .passkey }}"
encode: encode:
- torrentName - torrentName

View file

@ -64,6 +64,7 @@ irc:
- torrentId - torrentId
match: match:
infourl: "/browse/{{ .torrentId }}"
torrenturl: "/api/v1/torrents/{{ .torrentId }}/torrent?key={{ .apikey }}" torrenturl: "/api/v1/torrents/{{ .torrentId }}/torrent?key={{ .apikey }}"
encode: encode:
- apikey - apikey

View file

@ -69,4 +69,5 @@ irc:
- torrentId - torrentId
match: match:
infourl: "/torrents.php?torrentid={{ .torrentId }}"
torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&authkey={{ .authkey }}&torrent_pass={{ .torrent_pass }}" torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&authkey={{ .authkey }}&torrent_pass={{ .torrent_pass }}"

View file

@ -66,5 +66,6 @@ irc:
- freeleech - freeleech
match: match:
infourl: "/t/{{ .torrentId }}"
torrenturl: "/tor/download.php?tid={{ .torrentId }}" torrenturl: "/tor/download.php?tid={{ .torrentId }}"
torrentname: "{{ .torrentName }} by {{ .author }} [{{ .language }} / {{ .tags }}]" torrentname: "{{ .torrentName }} by {{ .author }} [{{ .language }} / {{ .tags }}]"

View file

@ -68,5 +68,6 @@ irc:
- torrentId - torrentId
match: match:
infourl: "/torrents.php?action=details&id={{ .torrentId }}"
# https://ncore.pro/torrents.php?action=download&id=0000&key=00000 # https://ncore.pro/torrents.php?action=download&id=0000&key=00000
torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&key={{ .passkey }}" torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&key={{ .passkey }}"

View file

@ -80,4 +80,5 @@ irc:
- tags - tags
match: match:
infourl: "/torrents.php?id={{ .torrentId }}"
torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&authkey={{ .authkey }}&torrent_pass={{ .torrent_pass }}" torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&authkey={{ .authkey }}&torrent_pass={{ .torrent_pass }}"

View file

@ -63,4 +63,5 @@ irc:
- torrentId - torrentId
match: match:
infourl: "/details.php?id={{ .torrentId }}"
torrenturl: "/download.php?id={{ .torrentId }}&passkey={{ .passkey }}" torrenturl: "/download.php?id={{ .torrentId }}&passkey={{ .passkey }}"

View file

@ -72,4 +72,5 @@ irc:
- torrentId - torrentId
match: match:
infourl: "/torrents.php?torrentid={{ .torrentId }}"
torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&torrent_pass={{ .torrent_pass }}" torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&torrent_pass={{ .torrent_pass }}"

View file

@ -69,4 +69,5 @@ irc:
- torrentId - torrentId
match: match:
infourl: "/torrents.php?id={{ .torrentId }}"
torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&authkey={{ .authkey }}&torrent_pass={{ .torrent_pass }}" torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&authkey={{ .authkey }}&torrent_pass={{ .torrent_pass }}"

View file

@ -87,4 +87,5 @@ irc:
- tags - tags
match: match:
infourl: "/torrents.php?torrentid={{ .torrentId }}"
torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&authkey={{ .authkey }}&torrent_pass={{ .torrent_pass }}" torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&authkey={{ .authkey }}&torrent_pass={{ .torrent_pass }}"

View file

@ -70,6 +70,7 @@ irc:
- preTime - preTime
match: match:
infourl: "/details.php?id={{ .torrentId }}"
torrenturl: "/downloadssl.php?id={{ .torrentId }}&torr={{ .torrentName }}.torrent&passkey={{ .passkey }}" torrenturl: "/downloadssl.php?id={{ .torrentId }}&torr={{ .torrentName }}.torrent&passkey={{ .passkey }}"
encode: encode:
- torrentName - torrentName

View file

@ -70,4 +70,5 @@ irc:
- torrentId - torrentId
match: match:
infourl: "/torrents/{{ .torrentId }}"
torrenturl: "/downrss/{{ .rsskey }}/{{ .torrentId }}" torrenturl: "/downrss/{{ .rsskey }}/{{ .torrentId }}"

View file

@ -64,6 +64,7 @@ irc:
- torrentId - torrentId
match: match:
infourl: "/details.php?id={{ .torrentId }}"
torrenturl: "/download.php/{{ .torrentId }}/{{ .rsskey }}/{{ .torrentName }}.torrent" torrenturl: "/download.php/{{ .torrentId }}/{{ .rsskey }}/{{ .torrentName }}.torrent"
encode: encode:
- torrentName - torrentName

View file

@ -61,4 +61,5 @@ irc:
- torrentId - torrentId
match: match:
infourl: "/details.php?id={{ .torrentId }}"
torrenturl: "/download.php?torrent={{ .torrentId }}&torrent_pass={{ .torrent_pass }}" torrenturl: "/download.php?torrent={{ .torrentId }}&torrent_pass={{ .torrent_pass }}"

View file

@ -104,4 +104,5 @@ irc:
- tags - tags
match: match:
infourl: "/torrents.php?torrentid={{ .torrentId }}"
torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&authkey={{ .authkey }}&torrent_pass={{ .torrent_pass }}" torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&authkey={{ .authkey }}&torrent_pass={{ .torrent_pass }}"

View file

@ -63,6 +63,7 @@ irc:
- torrentId - torrentId
match: match:
infourl: "/torrent/{{ .torrentId }}"
torrenturl: "/rss/download/{{ .torrentId }}/{{ .rsskey }}/{{ .torrentName }}.torrent" torrenturl: "/rss/download/{{ .torrentId }}/{{ .rsskey }}/{{ .torrentName }}.torrent"
encode: encode:
- torrentName - torrentName

View file

@ -96,4 +96,5 @@ irc:
- tags - tags
match: match:
infourl: "/torrents.php?torrentid={{ .torrentId }}"
torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&authkey={{ .authkey }}&torrent_pass={{ .torrent_pass }}" torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&authkey={{ .authkey }}&torrent_pass={{ .torrent_pass }}"

View file

@ -65,6 +65,7 @@ irc:
- torrentId - torrentId
match: match:
infourl: "/browse/t/{{ .torrentId }}/{{ .torrentName }}"
torrenturl: "/download.php?id={{ .torrentId }}&passkey={{ .passkey }}" torrenturl: "/download.php?id={{ .torrentId }}&passkey={{ .passkey }}"
encode: encode:
- torrentName - torrentName

View file

@ -68,6 +68,7 @@ irc:
- torrentId - torrentId
match: match:
infourl: "/details.php?id={{ .torrentId }}"
torrenturl: "/download.php/{{ .torrentId }}/{{ .torrentName }}.torrent?passkey={{ .passkey }}" torrenturl: "/download.php/{{ .torrentId }}/{{ .torrentName }}.torrent?passkey={{ .passkey }}"
encode: encode:
- torrentName - torrentName

View file

@ -67,4 +67,5 @@ irc:
- torrentId - torrentId
match: match:
infourl: "/details.php?id={{ .torrentId }}"
torrenturl: "/download.php?id={{ .torrentId }}&passkey={{ .passkey }}" torrenturl: "/download.php?id={{ .torrentId }}&passkey={{ .passkey }}"

View file

@ -65,4 +65,5 @@ irc:
- torrentId - torrentId
match: match:
infourl: "/torrents/{{ .torrentId }}"
torrenturl: "/torrent/download/{{ .torrentId }}.{{ .rsskey }}" torrenturl: "/torrent/download/{{ .torrentId }}.{{ .rsskey }}"

View file

@ -61,4 +61,5 @@ irc:
- torrentId - torrentId
match: match:
infourl: "/browse/{{ .torrentId }}/t/{{ .torrentName }}"
torrenturl: "/rss/download/{{ .torrentId }}/{{ .torrentName }}.torrent?passkey={{ .passkey }}" torrenturl: "/rss/download/{{ .torrentId }}/{{ .torrentName }}.torrent?passkey={{ .passkey }}"

View file

@ -64,4 +64,5 @@ irc:
- preTime - preTime
match: match:
infourl: "/torrent/{{ .torrentId }}/"
torrenturl: "/download.php?id={{ .torrentId }}&passkey={{ .passkey }}" torrenturl: "/download.php?id={{ .torrentId }}&passkey={{ .passkey }}"

View file

@ -67,6 +67,7 @@ irc:
- preTime - preTime
match: match:
infourl: "/details.php?id={{ .torrentId }}"
torrenturl: "/download.php?id={{ .torrentId }}&SSL=1&name={{ .torrentName }}.torrent" torrenturl: "/download.php?id={{ .torrentId }}&SSL=1&name={{ .torrentName }}.torrent"
cookie: true cookie: true
encode: encode:

View file

@ -71,6 +71,7 @@ irc:
- torrentSize - torrentSize
match: match:
infourl: "/details.php?id={{ .torrentId }}"
torrenturl: "/download.php/{{ .torrentId }}/{{ .torrentName }}.torrent?torrent_pass={{ .passkey }}" torrenturl: "/download.php/{{ .torrentId }}/{{ .torrentName }}.torrent?torrent_pass={{ .passkey }}"
encode: encode:
- torrentName - torrentName

View file

@ -68,6 +68,7 @@ irc:
- torrentId - torrentId
match: match:
infourl: "/torrent/{{ .torrentId }}"
torrenturl: "/rss/download/{{ .torrentId }}/{{ .rsskey }}/{{ .torrentName }}.torrent" torrenturl: "/rss/download/{{ .torrentId }}/{{ .rsskey }}/{{ .torrentName }}.torrent"
encode: encode:
- torrentName - torrentName

View file

@ -66,4 +66,5 @@ irc:
- torrentId - torrentId
match: match:
infourl: "/torrent/{{ .torrentId }}"
torrenturl: "/download/{{ .torrentId }}/{{ .passkey }}" torrenturl: "/download/{{ .torrentId }}/{{ .passkey }}"

View file

@ -69,4 +69,5 @@ irc:
- uploader - uploader
match: match:
infourl: "/torrents/{{ .torrentId }}"
torrenturl: "/torrent/download/{{ .torrentId }}.{{ .rsskey }}" torrenturl: "/torrent/download/{{ .torrentId }}.{{ .rsskey }}"

View file

@ -71,4 +71,5 @@ irc:
- torrentId - torrentId
- tags - tags
match: match:
infourl: "/details.php?id={{ .torrentId }}"
torrenturl: "/download.php?id={{ .torrentId }}&apikey={{ .api_key }}" torrenturl: "/download.php?id={{ .torrentId }}&apikey={{ .api_key }}"

View file

@ -76,6 +76,7 @@ irc:
- torrentId - torrentId
match: match:
infourl: "/details.php?id={{ .torrentId }}"
torrenturl: "/download.php/{{ .torrentId }}/{{ .torrentName }}.torrent?passkey={{ .passkey }}" torrenturl: "/download.php/{{ .torrentId }}/{{ .torrentName }}.torrent?passkey={{ .passkey }}"
encode: encode:
- torrentName - torrentName

View file

@ -78,4 +78,5 @@ irc:
- torrentId - torrentId
match: match:
infourl: "/torrents.php?torrentid={{ .torrentId }}"
torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&authkey={{ .authkey }}&torrent_pass={{ .torrent_pass }}" torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&authkey={{ .authkey }}&torrent_pass={{ .torrent_pass }}"

View file

@ -104,4 +104,5 @@ irc:
- torrentId - torrentId
match: match:
infourl: "/details.php?id={{ .torrentId }}"
torrenturl: "/download.php?type=rss&secret_key={{ .passkey }}&id={{ .torrentId }}" torrenturl: "/download.php?type=rss&secret_key={{ .passkey }}&id={{ .torrentId }}"

View file

@ -16,6 +16,24 @@ export const AgeCell = ({ value }: CellProps) => (
</div> </div>
); );
export const IndexerCell = ({ value }: CellProps) => (
<div
className={classNames(
"py-3 text-sm font-medium box-content text-gray-900 dark:text-gray-300",
"max-w-[96px] sm:max-w-[216px] md:max-w-[360px] lg:max-w-[640px] xl:max-w-[840px]"
)}
>
<Tooltip
label={value}
maxWidth="max-w-[90vw]"
>
<span className="whitespace-pre-wrap break-words">
{value}
</span>
</Tooltip>
</div>
);
export const TitleCell = ({ value }: CellProps) => ( export const TitleCell = ({ value }: CellProps) => (
<div <div
className={classNames( className={classNames(

View file

@ -1,6 +1,6 @@
import * as React from "react"; import * as React from "react";
import { useQuery } from "react-query"; import { useQuery } from "react-query";
import { Column, useFilters, usePagination, useSortBy, useTable } from "react-table"; import { CellProps, Column, useFilters, usePagination, useSortBy, useTable } from "react-table";
import { import {
ChevronDoubleLeftIcon, ChevronDoubleLeftIcon,
ChevronDoubleRightIcon, ChevronDoubleRightIcon,
@ -15,6 +15,9 @@ import * as Icons from "../../components/Icons";
import * as DataTable from "../../components/data-table"; import * as DataTable from "../../components/data-table";
import { IndexerSelectColumnFilter, PushStatusSelectColumnFilter, SearchColumnFilter } from "./Filters"; import { IndexerSelectColumnFilter, PushStatusSelectColumnFilter, SearchColumnFilter } from "./Filters";
import { classNames } from "../../utils";
import { ArrowTopRightOnSquareIcon } from "@heroicons/react/24/outline";
import { Tooltip } from "../../components/tooltips/Tooltip";
type TableState = { type TableState = {
queryPageIndex: number; queryPageIndex: number;
@ -68,7 +71,35 @@ export const ReleaseTable = () => {
{ {
Header: "Release", Header: "Release",
accessor: "torrent_name", accessor: "torrent_name",
Cell: DataTable.TitleCell, Cell: (props: CellProps<Release>) => {
return (
<div
className={classNames(
"flex justify-between py-3 text-sm font-medium box-content text-gray-900 dark:text-gray-300",
"max-w-[96px] sm:max-w-[216px] md:max-w-[360px] lg:max-w-[640px] xl:max-w-[840px]"
)}
>
<Tooltip
label={props.cell.value}
maxWidth="max-w-[90vw]"
>
<span className="whitespace-pre-wrap break-words">
{String(props.cell.value)}
</span>
</Tooltip>
{props.row.original.info_url && (
<a
rel="noopener noreferrer"
target="_blank"
href={props.row.original.info_url}
className="max-w-[90vw] mr-2"
>
<ArrowTopRightOnSquareIcon className="h-5 w-5 text-blue-400 hover:text-blue-500 dark:text-blue-500 dark:hover:text-blue-600" aria-hidden="true" />
</a>
)}
</div>
);
},
Filter: SearchColumnFilter Filter: SearchColumnFilter
}, },
{ {
@ -80,7 +111,7 @@ export const ReleaseTable = () => {
{ {
Header: "Indexer", Header: "Indexer",
accessor: "indexer", accessor: "indexer",
Cell: DataTable.TitleCell, Cell: DataTable.IndexerCell,
Filter: IndexerSelectColumnFilter, Filter: IndexerSelectColumnFilter,
filter: "equal" filter: "equal"
} }

View file

@ -8,6 +8,8 @@ interface Release {
title: string; title: string;
size: number; size: number;
raw: string; raw: string;
info_url: string;
download_url: string;
timestamp: Date timestamp: Date
action_status: ReleaseActionStatus[] action_status: ReleaseActionStatus[]
} }