-
Notifications
You must be signed in to change notification settings - Fork 0
/
HdWallpaperc.cs
55 lines (50 loc) · 1.94 KB
/
HdWallpaperc.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using Spectre.Console;
namespace wally
{
public class HdWallpaper : BaseClass
{
public HdWallpaper(string query)
{
base.baseURL = "https://www.hdwallpapers.in";
base.searchBaseURL = "https://www.hdwallpapers.in/search.html?q=";
base.searchURL = base.searchBaseURL + query;
folder_name = "HdWallpapers";
GetLinks("//*[@id=\"content\"]/div[3]/ul/li/div/a");
}
public void Download(bool random = false)
{
random_download = random;
nodes = SingleResolution("//*[@id=\"content\"]/div[3]/article/div[2]/a");
foreach (var item in nodes)
{
if (item.InnerText.Trim().Replace(" ", "") == resolution)
{
string link = baseURL + "/" + item.Attributes["href"].Value;
AnsiConsole.MarkupLine($"[green][[+]] Checking Folder and file name...[/]");
string fileName = link.Split("/")[4];
destFile = GetDestFile(fileName);
base.Download(link);
}
}
}
public void MultiDownload(bool random = false)
{
random_download = random;
nodes = MultiResolution("//*[@id=\"content\"]/div[3]/article/div[2]/a");
foreach (var item in nodes)
{
foreach (var res in multi_resolution)
{
if (item.InnerText.Trim().Replace(" ", "") == res)
{
string link = baseURL + "/" + item.Attributes["href"].Value;
AnsiConsole.MarkupLine($"[green][[+]] Checking Folder and file name...[/]");
string fileName = link.Split("/")[4];
destFile = GetDestFile(fileName);
base.Download(link);
}
}
}
}
}
}