Skip to content

Commit ddf7d82

Browse files
committed
Small fix
- Maximum timeout of 8 seconds added for each request - Site detection problem for Reddit fixed
1 parent 477b544 commit ddf7d82

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Emora/Form1.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ private class WebsiteInfo
3939
{"Pastebin", new WebsiteInfo {ErrorType = "status_code", Url = "https://pastebin.com/u/{}"}},
4040
{"Patreon", new WebsiteInfo {ErrorType = "status_code", Url = "https://www.patreon.com/{}"}},
4141
{"PyPi", new WebsiteInfo {ErrorType = "status_code", Url = "https://pypi.org/user/{}"}},
42-
{"Reddit", new WebsiteInfo {ErrorType = "status_code", Url = "https://www.reddit.com/user/{}"}},
42+
{"Reddit", new WebsiteInfo {ErrorType = "message", ErrorMessage = "{\"message\": \"Not Found\", \"error\": 404}", Url = "https://www.reddit.com/user/{}/about.json"}},
4343
{"Replit", new WebsiteInfo {ErrorType = "status_code", Url = "https://replit.com/@{}"}},
4444
{"Roblox", new WebsiteInfo {ErrorType = "status_code", Url = "https://www.roblox.com/user.aspx?username={}"}},
4545
{"RootMe", new WebsiteInfo {ErrorType = "status_code", Url = "https://www.root-me.org/{}"}},
@@ -117,6 +117,7 @@ private async void btn_search_Click(object sender, EventArgs e)
117117

118118
using (var httpClient = new HttpClient())
119119
{
120+
httpClient.Timeout = TimeSpan.FromSeconds(8);
120121
httpClient.DefaultRequestHeaders.UserAgent.ParseAdd("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0");
121122
var tasks = new List<Task>();
122123
var semaphore = new SemaphoreSlim((int)numericUpDown1.Value);

0 commit comments

Comments
 (0)