public static async Task <string> ProcessVideo( [ActivityTrigger] DurableActivityContext ctx, TraceWriter log ) { var url = ctx.GetInput <string>(); var asm = Assembly.Load("Microsoft.Extensions.Options, Culture=neutral, PublicKeyToken=adb9793829ddae60"); PuppeteerSharp.Browser browser = null; try { browser = await Puppeteer.ConnectAsync(new ConnectOptions { BrowserWSEndpoint = Constants.BrowserWSEndpoint }); var page = await browser.NewPageAsync(); await page.GoToAsync(url, new NavigationOptions { Timeout = 4000 }); } catch (Exception ex) { return(ex.Message); } finally { if (browser != null) { browser.Disconnect(); } } return($"Processed {url} shit all."); }
private void Cleanup(PuppeteerSharp.Browser browser) { browser.Disconnect(); Dispose(); }