Read from archive file
Can now read from archive file and extract the video id
This commit is contained in:
parent
37dbc55a58
commit
7dd166e52a
37
Program.cs
37
Program.cs
@ -4,29 +4,36 @@ using OpenQA.Selenium.Firefox;
|
|||||||
public class Program {
|
public class Program {
|
||||||
static void Main(string[] args) {
|
static void Main(string[] args) {
|
||||||
|
|
||||||
Console.WriteLine("Test started");
|
Console.WriteLine("Starting");
|
||||||
|
|
||||||
IWebDriver driver = new FirefoxDriver();
|
IWebDriver driver = new FirefoxDriver();
|
||||||
|
|
||||||
// Base url: https://downsub.com/?url=https%253A%252F%252Fwww.youtube.com%252Fwatch%253Fv%253D
|
// Base url: https://downsub.com/?url=https%253A%252F%252Fwww.youtube.com%252Fwatch%253Fv%253D
|
||||||
// Finished url: https://downsub.com/?url=https%253A%252F%252Fwww.youtube.com%252Fwatch%253Fv%253D + video id
|
// Finished url: https://downsub.com/?url=https%253A%252F%252Fwww.youtube.com%252Fwatch%253Fv%253D + video id
|
||||||
driver.Navigate().GoToUrl("https://downsub.com/?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DPQ54uUV41-k");
|
string[] lines = File.ReadAllLines(@"/nfs/andre/Archive/Vtuber/Hologra/hologra_downloaded.txt");
|
||||||
Thread.Sleep(5000);
|
foreach (string line in lines) {
|
||||||
|
string videoId = line.Substring(8, 11);
|
||||||
|
string fullUrl = "https://downsub.com/?url=https%253A%252F%252Fwww.youtube.com%252Fwatch%253Fv%253D" + videoId;
|
||||||
|
|
||||||
IWebElement drop = driver.FindElement(By.XPath("//button[@class='v-expansion-panel-header px-4 py-2']")); // Open Dropdown [WORKS]
|
driver.Navigate().GoToUrl(fullUrl);
|
||||||
drop.SendKeys(Keys.Enter);
|
Thread.Sleep(5000);
|
||||||
Thread.Sleep(1000);
|
|
||||||
|
|
||||||
IWebElement check = driver.FindElement(By.Id("input-885")); // Click button to disable tag stripping [WORKS]
|
|
||||||
check.SendKeys(Keys.Space);
|
|
||||||
Thread.Sleep(1000);
|
|
||||||
|
|
||||||
IWebElement sub = driver.FindElement(By.XPath("//button[@data-title='[SRT] English']")); // Download subtitle file [WORKS]
|
IWebElement drop = driver.FindElement(By.XPath("//button[@class='v-expansion-panel-header px-4 py-2']")); // Open Dropdown [WORKS]
|
||||||
sub.Click();
|
drop.SendKeys(Keys.Enter);
|
||||||
Thread.Sleep(3000);
|
Thread.Sleep(1000);
|
||||||
|
|
||||||
driver.Close();
|
IWebElement check = driver.FindElement(By.Id("input-885")); // Click button to disable tag stripping [WORKS]
|
||||||
|
check.SendKeys(Keys.Space);
|
||||||
|
Thread.Sleep(1000);
|
||||||
|
|
||||||
Console.WriteLine("Test ended");
|
IWebElement sub = driver.FindElement(By.XPath("//button[@data-title='[SRT] English']")); // Download subtitle file [WORKS]
|
||||||
|
sub.Click();
|
||||||
|
Thread.Sleep(3000);
|
||||||
|
|
||||||
|
driver.Close();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.WriteLine("Ended");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user