-
Notifications
You must be signed in to change notification settings - Fork 131
Fail to download torrent file if we got redirect and we use cookie #410
Description
найдено из-за #400
с https://www3.yggtorrent.wtf сейчас идёт редирект на https://www3.yggtorrent.cool
казалось бы не надо ничего менять в json конфиге, но если не сменить домен для хотя бы "torrent": то не получается скачать торрент файл.
Если в elementum включить встроенный прокси, у него включить дебаг в лог, а в burst включить использование этого прокси - то будет видно что происходит:
идёт авторизация на .wtf, получает редирект на .cool, получает куки на .cool, идёт скачивание на .wtf без кук (у нас куки от другого домена), получает редирект 301 .cool, идёт на .cool с куками, но сайт отвечает что надо авторизоваться. Если редиректов нет (если поправить json для хотябы "torrent":), то работает нормально с теми же куками.
Поиск работает нормально с редиректом, потому что не обязательна авторизация для поиска у них, а вот именно скачка торрента не работает, так как там обязательна авторизация у них. Но мы выставляем же куки вроде, как у меня в логе ниже. похоже что не выставляем.
Я так и не понял это проблема самого сайта или burst. @elgatito прошу глянуть.
DEBU proxy ▶ dumpRequest [787] --> GET https://www3.yggtorrent.wtf:443/engine/download_torrent?id=1054618
DEBU proxy ▶ dumpRequest REQUEST:
GET /engine/download_torrent?id=1054618 HTTP/1.1
Host: www3.yggtorrent.wtf
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36
DEBU proxy ▶ dumpResponse [787] <-- 301 https://www3.yggtorrent.wtf:443/engine/download_torrent?id=1054618
DEBU proxy ▶ dumpResponse RESPONSE:
HTTP/1.1 301 Moved Permanently
Content-Length: 167
Alt-Svc: h3=":443"; ma=86400
Cache-Control: max-age=3600
Cf-Ray: 87b7c6091c563253-VIE
Connection: keep-alive
Content-Type: text/html
Date: Sun, 28 Apr 2024 14:34:31 GMT
Expires: Sun, 28 Apr 2024 15:34:31 GMT
Location: https://www3.yggtorrent.cool/engine/download_torrent?id=1054618
Nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=URPG%2B3LeBNnH5v7fBD9tBYcjVvWr%2FymO3ywcXyY5rZF%2FaZ5MCoasHzuu2y3QXmnDt%2FlxnXkl%2BjtpCNyKEeWbwKKCU9EHtnRRQjLcQ679BqXIdZKZw8nvu4k3Rrgp8PVd3eB%2B57tK"}],"group":"cf-nel","max_age":604800}
Server: cloudflare
Vary: Accept-Encoding
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>cloudflare</center>
</body>
</html>
DEBU proxy ▶ dumpRequest [821] --> GET https://www3.yggtorrent.cool:443/engine/download_torrent?id=1054618
DEBU proxy ▶ dumpRequest REQUEST:
GET /engine/download_torrent?id=1054618 HTTP/1.1
Host: www3.yggtorrent.cool
Referer: https://www3.yggtorrent.wtf/engine/download_torrent?id=1054618
DEBU proxy ▶ dumpResponse [821] <-- 200 https://www3.yggtorrent.cool:443/engine/download_torrent?id=1054618
DEBU proxy ▶ dumpResponse RESPONSE:
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Cache-Control: no-store, no-cache, must-revalidate
Cf-Cache-Status: DYNAMIC
Cf-Ray: 87b7c60b8e602bcd-FRA
Connection: keep-alive
Content-Type: text/html; charset=UTF-8
Date: Sun, 28 Apr 2024 14:34:31 GMT
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
Pragma: no-cache
Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=rZ5bMQsNoZ8SRTfP8p6UKStEjx1w6ixSZb4ROxCEpP%2BNDCZNXTmTLjc1C8Y1%2FedQwuu8%2B8mIQhAo7ecL5Xa0ZJuT3xbwzyRwAzD5g8kzoB7czsUz6GOlselzHbQpf%2BA47JB6KPif"}],"group":"cf-nel","max_age":604800}
Server: cloudflare
Set-Cookie: ygg_=xxx; expires=Sun, 28-Apr-2024 16:34:31 GMT; Max-Age=7200; path=/; SameSite=None; domain=.yggtorrent.cool; secure; HttpOnly
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
37
Vous devez vous connecter pour télécharger un torrent
0
WARN linkssearch ▶ 1 Resolve failed for https://www3.yggtorrent.wtf/engine/download_torrent?id=1054618|User-Agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36 : Invalid input
Vous devez vous connecter pour télécharger un torrent -> Вы должны войти в систему, чтобы скачать торрент
UPD:
ещё вижу что был фикс когда-то на похожую тему "added fixes for having redirections from providers".