Skip to content

Commit

Permalink
add user agent
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoey2936 committed Aug 18, 2024
1 parent e600c7a commit cb8e06e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async def mini(ctx, prompt: discord.Option(str, description="Der Prompt"), url:
async with async_playwright() as playwright:
chromium = playwright.chromium
browser = await chromium.launch()
page = await browser.new_page()
page = await browser.new_page(locale="de-DE", timezone_id="Europe/berlin", user_agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36")
await page.goto(url)
await page.emulate_media(media="screen")
pdf = await page.pdf(width="1440px", height="2560px", landscape=True)
Expand Down Expand Up @@ -128,7 +128,7 @@ async def gpt(ctx, prompt: discord.Option(str, description="Der Prompt"), url: d
async with async_playwright() as playwright:
chromium = playwright.chromium
browser = await chromium.launch()
page = await browser.new_page()
page = await browser.new_page(locale="de-DE", timezone_id="Europe/berlin", user_agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36")
await page.goto(url)
await page.emulate_media(media="screen")
pdf = await page.pdf(width="1440px", height="2560px", landscape=True)
Expand Down

0 comments on commit cb8e06e

Please sign in to comment.