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 {
rls.TorrentURL = matched.TorrentURL
if matched.InfoURL != "" {
rls.InfoURL = matched.InfoURL
}
// only used by few indexers
if matched.TorrentName != "" {
rls.TorrentName = matched.TorrentName

View file

@ -199,6 +199,8 @@ CREATE TABLE "release"
protocol TEXT,
implementation TEXT,
timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
info_url TEXT,
download_url TEXT,
group_id TEXT,
torrent_id TEXT,
torrent_name TEXT,
@ -647,4 +649,10 @@ UPDATE release_action_status
SET filter_id = (SELECT f.id
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.
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").
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).
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.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)
// return values
@ -205,7 +205,7 @@ func (repo *ReleaseRepo) findReleases(ctx context.Context, tx *Tx, params domain
}
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").
Column(sq.Alias(countQuery, "page_total")).
From("release r").
@ -239,14 +239,14 @@ func (repo *ReleaseRepo) findReleases(ctx context.Context, tx *Tx, params domain
var rls domain.Release
var ras domain.ReleaseActionStatus
var rlsindexer, rlsfilter sql.NullString
var rlsindexer, rlsfilter, infoUrl, downloadUrl sql.NullString
var rasId sql.NullInt64
var rasStatus, rasAction, rasType, rasClient, rasFilter sql.NullString
var rasRejections []sql.NullString
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")
}
@ -280,6 +280,8 @@ func (repo *ReleaseRepo) findReleases(ctx context.Context, tx *Tx, params domain
rls.Indexer = rlsindexer.String
rls.FilterName = rlsfilter.String
rls.ActionStatus = make([]domain.ReleaseActionStatus, 0)
rls.InfoURL = infoUrl.String
rls.TorrentURL = downloadUrl.String
// only add ActionStatus if it's not empty
if ras.ID > 0 {

View file

@ -199,6 +199,8 @@ CREATE TABLE "release"
protocol TEXT,
implementation TEXT,
timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
info_url TEXT,
download_url TEXT,
group_id TEXT,
torrent_id TEXT,
torrent_name TEXT,
@ -1040,4 +1042,10 @@ UPDATE release_action_status
SET filter_id = (SELECT f.id
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 {
TorrentURL string `json:"torrenturl"`
TorrentName string `json:"torrentname"`
InfoURL string `json:"infourl"`
Encode []string `json:"encode"`
}
type IndexerIRCParseMatched struct {
InfoURL string
TorrentURL 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 != "" {
// setup text template to inject variables into
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"`
Implementation ReleaseImplementation `json:"implementation"` // irc, rss, api
Timestamp time.Time `json:"timestamp"`
InfoURL string `json:"info_url"`
TorrentURL string `json:"download_url"`
GroupID string `json:"group_id"`
TorrentID string `json:"torrent_id"`
TorrentURL string `json:"-"`
TorrentTmpFile string `json:"-"`
TorrentDataRawBytes []byte `json:"-"`
TorrentHash string `json:"-"`

View file

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

View file

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

View file

@ -83,4 +83,5 @@ irc:
- auto
match:
infourl: "/torrents.php?id={{ .torrentId }}"
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"
- "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"
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:
- torrentName
- title
@ -78,10 +78,12 @@ irc:
- releaseEpisode
- freeleech
- baseUrl
- groupId
- torrentId
- tags
- uploader
match:
infourl: "/torrents.php?id={{ .groupId }}&torrentid={{ .torrentId }}"
torrenturl: "/torrent/{{ .torrentId }}/download/{{ .passkey }}"
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
match:
infourl: "/torrents.php?id={{ .torrentId }}"
torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&torrent_pass={{ .torrent_pass }}"

View file

@ -59,7 +59,7 @@ irc:
type: single
lines:
- 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+)'
vars:
- torrentName
@ -70,4 +70,5 @@ irc:
- torrentId
match:
infourl: "/torrents/autodl?id={{ .torrentId }}"
torrenturl: "/torrent/download/auto.{{ .torrentId }}.{{ .rsskey }}"

View file

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

View file

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

View file

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

View file

@ -96,10 +96,12 @@ irc:
- preTime
- test:
- "[ 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:
- baseUrl
- groupId
- torrentId
match:
infourl: "/torrents.php?id={{ .groupId }}&torrentid={{ .torrentId }}"
torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&authkey={{ .authkey }}&torrent_pass={{ .torrent_pass }}"

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -16,6 +16,24 @@ export const AgeCell = ({ value }: CellProps) => (
</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) => (
<div
className={classNames(

View file

@ -1,6 +1,6 @@
import * as React from "react";
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 {
ChevronDoubleLeftIcon,
ChevronDoubleRightIcon,
@ -15,6 +15,9 @@ import * as Icons from "../../components/Icons";
import * as DataTable from "../../components/data-table";
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 = {
queryPageIndex: number;
@ -68,7 +71,35 @@ export const ReleaseTable = () => {
{
Header: "Release",
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
},
{
@ -80,7 +111,7 @@ export const ReleaseTable = () => {
{
Header: "Indexer",
accessor: "indexer",
Cell: DataTable.TitleCell,
Cell: DataTable.IndexerCell,
Filter: IndexerSelectColumnFilter,
filter: "equal"
}

View file

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