Private GIT
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
Jackett
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vlbox
Jackett
Commits
d8987257
Commit
d8987257
authored
10 years ago
by
zone117x
Browse files
Options
Downloads
Patches
Plain Diff
TorrentDay login fix
parent
e93e95a9
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Jackett/Indexers/TorrentDay.cs
+23
-6
23 additions, 6 deletions
src/Jackett/Indexers/TorrentDay.cs
with
23 additions
and
6 deletions
src/Jackett/Indexers/TorrentDay.cs
+
23
−
6
View file @
d8987257
...
...
@@ -36,9 +36,12 @@ namespace Jackett.Indexers
public
bool
IsConfigured
{
get
;
private
set
;
}
const
string
BaseUrl
=
"https://torrentday.eu"
;
const
string
LoginUrl
=
BaseUrl
+
"/takelogin.php"
;
const
string
StartPageUrl
=
BaseUrl
+
"/login.php"
;
const
string
LoginUrl
=
BaseUrl
+
"/tak3login.php"
;
const
string
SearchUrl
=
BaseUrl
+
"/browse.php?search={0}&cata=yes&c2=1&c7=1&c14=1&c24=1&c26=1&c31=1&c32=1&c33=1"
;
const
string
chromeUserAgent
=
"Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36"
;
CookieContainer
cookies
;
HttpClientHandler
handler
;
HttpClient
client
;
...
...
@@ -62,21 +65,35 @@ namespace Jackett.Indexers
return
Task
.
FromResult
<
ConfigurationData
>(
config
);
}
HttpRequestMessage
CreateHttpRequest
(
string
uri
)
{
var
message
=
new
HttpRequestMessage
();
message
.
Method
=
HttpMethod
.
Get
;
message
.
RequestUri
=
new
Uri
(
uri
);
message
.
Headers
.
UserAgent
.
ParseAdd
(
chromeUserAgent
);
return
message
;
}
public
async
Task
ApplyConfiguration
(
JToken
configJson
)
{
var
config
=
new
ConfigurationDataBasicLogin
();
config
.
LoadValuesFromJson
(
configJson
);
var
startMessage
=
CreateHttpRequest
(
StartPageUrl
);
var
results
=
await
(
await
client
.
SendAsync
(
startMessage
)).
Content
.
ReadAsStringAsync
();
var
pairs
=
new
Dictionary
<
string
,
string
>
{
{
"username"
,
config
.
Username
.
Value
},
{
"password"
,
config
.
Password
.
Value
},
{
"keeplogged"
,
"1"
},
{
"login"
,
"Login"
}
{
"password"
,
config
.
Password
.
Value
}
};
var
content
=
new
FormUrlEncodedContent
(
pairs
);
var
loginRequest
=
CreateHttpRequest
(
LoginUrl
);
loginRequest
.
Method
=
HttpMethod
.
Post
;
loginRequest
.
Content
=
content
;
loginRequest
.
Headers
.
Referrer
=
new
Uri
(
StartPageUrl
);
var
response
=
await
client
.
Post
Async
(
L
ogin
Url
,
conten
t
);
var
response
=
await
client
.
Send
Async
(
l
ogin
Reques
t
);
var
responseContent
=
await
response
.
Content
.
ReadAsStringAsync
();
if
(!
responseContent
.
Contains
(
"logout.php"
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment