cross-seed / cross-seed

Fully-automatic cross-seeding with Torznab
https://cross-seed.org
Apache License 2.0
858 stars 69 forks source link

cross-seed is sending double-urlencoded search strings to Prowlarr #260

Closed sjtuross closed 2 years ago

sjtuross commented 2 years ago

Currently non-Latin characters in torrent name is got encoded and then sent to indexers as search term. So no torrents can be matched.

For example, these Chinese characters 蜘蛛侠:平行宇宙 are encoded to %E8%9C%98%E8%9B%9B%E4%BE%A0%EF%BC%9A%E5%B9%B3%E8%A1%8C%E5%AE%87%E5%AE%99 as part of the search term as shown in the cross-seed log and prowlarr log.

Is there a way to send the original term or the decoded version?

cross-seed log

2022-06-04 20:33:05 verbose: [server] POST /api/webhook
2022-06-04 20:33:05 info: [server] Received search request: { infoHash: 'cb70eea5b7f3de377b77f8da33ffec071e485404' }
2022-06-04 20:33:05 verbose: [torznab] https://prowlarr.example.com/3/api?apikey=[REDACTED]&t=search&q=%25E8%259C%2598%25E8%259B%259B%25E4%25BE%25A0%25EF%25BC%259A%25E5%25B9%25B3%25E8%25A1%258C%25E5%25AE%2587%25E5%25AE%2599+Spider+Man+Into+The+Spider+Verse+2018
2022-06-04 20:33:05 verbose: [torznab] https://prowlarr.example.com/5/api?apikey=[REDACTED]&t=search&q=%25E8%259C%2598%25E8%259B%259B%25E4%25BE%25A0%25EF%25BC%259A%25E5%25B9%25B3%25E8%25A1%258C%25E5%25AE%2587%25E5%25AE%2599+Spider+Man+Into+The+Spider+Verse+2018
2022-06-04 20:33:05 verbose: [torznab] https://prowlarr.example.com/6/api?apikey=[REDACTED]&t=search&q=%25E8%259C%2598%25E8%259B%259B%25E4%25BE%25A0%25EF%25BC%259A%25E5%25B9%25B3%25E8%25A1%258C%25E5%25AE%2587%25E5%25AE%2599+Spider+Man+Into+The+Spider+Verse+2018
2022-06-04 20:33:05 verbose: [torznab] https://prowlarr.example.com/9/api?apikey=[REDACTED]&t=search&q=%25E8%259C%2598%25E8%259B%259B%25E4%25BE%25A0%25EF%25BC%259A%25E5%25B9%25B3%25E8%25A1%258C%25E5%25AE%2587%25E5%25AE%2599+Spider+Man+Into+The+Spider+Verse+2018
2022-06-04 20:33:05 verbose: [torznab] https://prowlarr.example.com/12/api?apikey=[REDACTED]&t=search&q=%25E8%259C%2598%25E8%259B%259B%25E4%25BE%25A0%25EF%25BC%259A%25E5%25B9%25B3%25E8%25A1%258C%25E5%25AE%2587%25E5%25AE%2599+Spider+Man+Into+The+Spider+Verse+2018
2022-06-04 20:33:05 verbose: [torznab] https://prowlarr.example.com/13/api?apikey=[REDACTED]&t=search&q=%25E8%259C%2598%25E8%259B%259B%25E4%25BE%25A0%25EF%25BC%259A%25E5%25B9%25B3%25E8%25A1%258C%25E5%25AE%2587%25E5%25AE%2599+Spider+Man+Into+The+Spider+Verse+2018
2022-06-04 20:33:05 verbose: [torznab] https://prowlarr.example.com/14/api?apikey=[REDACTED]&t=search&q=%25E8%259C%2598%25E8%259B%259B%25E4%25BE%25A0%25EF%25BC%259A%25E5%25B9%25B3%25E8%25A1%258C%25E5%25AE%2587%25E5%25AE%2599+Spider+Man+Into+The+Spider+Verse+2018
2022-06-04 20:34:13 info: [server] Found 0 torrents for { infoHash: 'cb70eea5b7f3de377b77f8da33ffec071e485404' }

prowlarr log

2022-06-04 20:32:43.9|Info|ReleaseSearchService|Searching indexer(s): [] for Term: [%E8%9C%98%E8%9B%9B%E4%BE%A0%EF%BC%9A%E5%B9%B3%E8%A1%8C%E5%AE%87%E5%AE%99 Spider Man Into The Spider Verse 2018], Offset: 0, Limit: 0, Categories: []
2022-06-04 20:32:43.9|Info|ReleaseSearchService|Searching indexer(s): [ToTheGloryCookie] for Term: [%E8%9C%98%E8%9B%9B%E4%BE%A0%EF%BC%9A%E5%B9%B3%E8%A1%8C%E5%AE%87%E5%AE%99 Spider Man Into The Spider Verse 2018], Offset: 0, Limit: 0, Categories: []
2022-06-04 20:32:43.9|Info|Cardigann|Adding request: https://totheglory.im/browse.php?search_field=%25E8%259C%2598%25E8%259B%259B%25E4%25BE%25A0%25EF%25BC%259A%25E5%25B9%25B3%25E8%25A1%258C%25E5%25AE%2587%25E5%25AE%2599+Spider+Man+Into+The+Spider+Verse+2018&c=M
2022-06-04 20:32:43.9|Info|ReleaseSearchService|Searching indexer(s): [] for Term: [%E8%9C%98%E8%9B%9B%E4%BE%A0%EF%BC%9A%E5%B9%B3%E8%A1%8C%E5%AE%87%E5%AE%99 Spider Man Into The Spider Verse 2018], Offset: 0, Limit: 0, Categories: []
2022-06-04 20:32:43.9|Info|ReleaseSearchService|Searching indexer(s): [HDChina] for Term: [%E8%9C%98%E8%9B%9B%E4%BE%A0%EF%BC%9A%E5%B9%B3%E8%A1%8C%E5%AE%87%E5%AE%99 Spider Man Into The Spider Verse 2018], Offset: 0, Limit: 0, Categories: []
2022-06-04 20:32:43.9|Info|ReleaseSearchService|Searching indexer(s): [] for Term: [%E8%9C%98%E8%9B%9B%E4%BE%A0%EF%BC%9A%E5%B9%B3%E8%A1%8C%E5%AE%87%E5%AE%99 Spider Man Into The Spider Verse 2018], Offset: 0, Limit: 0, Categories: []
2022-06-04 20:32:43.9|Info|ReleaseSearchService|Searching indexer(s): [] for Term: [%E8%9C%98%E8%9B%9B%E4%BE%A0%EF%BC%9A%E5%B9%B3%E8%A1%8C%E5%AE%87%E5%AE%99 Spider Man Into The Spider Verse 2018], Offset: 0, Limit: 0, Categories: []
2022-06-04 20:32:43.9|Info|Cardigann|Adding request: https://hdchina.org/torrents.php?search=%25E8%259C%2598%25E8%259B%259B%25E4%25BE%25A0%25EF%25BC%259A%25E5%25B9%25B3%25E8%25A1%258C%25E5%25AE%2587%25E5%25AE%2599+Spider+Man+Into+The+Spider+Verse+2018&incldead=0&spstate=0&search_area=0&search_mode=0
2022-06-04 20:32:43.9|Info|ReleaseSearchService|Searching indexer(s): [] for Term: [%E8%9C%98%E8%9B%9B%E4%BE%A0%EF%BC%9A%E5%B9%B3%E8%A1%8C%E5%AE%87%E5%AE%99 Spider Man Into The Spider Verse 2018], Offset: 0, Limit: 0, Categories: []
mmgoodnow commented 2 years ago

@bakerboy I would have thought that URL encoding the search term is spec-compliant?

bakerboy448 commented 2 years ago

@Qstick?

bakerboy448 commented 2 years ago

seems to be double encoded on cross-seeds end

image

mmgoodnow commented 2 years ago

ok i see as well:

> const str = "%25E8%259C%2598%25E8%259B%259B%25E4%25BE%25A0%25EF%25BC%259A%25E5%25B9%25B3%25E8%25A1%258C%25E5%25AE%2587%25E5%25AE%2599+Spider+Man+Into+The+Spider+Verse+2018"

> decodeURIComponent(str)
'%E8%9C%98%E8%9B%9B%E4%BE%A0%EF%BC%9A%E5%B9%B3%E8%A1%8C%E5%AE%87%E5%AE%99+Spider+Man+Into+The+Spider+Verse+2018'

> decodeURIComponent(decodeURIComponent(str))
'蜘蛛侠:平行宇宙+Spider+Man+Into+The+Spider+Verse+2018'
mmgoodnow commented 2 years ago

v4.3.3