Code that uploads videos on youtube

import webbrowser import pyautogui import time # Open the URL in a web browser url = “ (url) # Wait for the web browser window to open (2) # Get the screen size and calculate the desired position screen_width, screen_height = () desired_screen = 1 # Specify the desired screen number (0, 1, 2, etc.) desired_x = screen_width * desired_screen desired_y = 0 # Set the target coordinates x = 969 y = 705 # Move the mouse to the desired location (x, y, duration=0.5) # Wait for the web browser window to open (2) # Perform a mouse click () # Wait for the web browser window to open (2) # Type the text “cEDHTV“ and press Enter (“cedhtv“) (“enter“) # Wait until the webpage has updated (2) # Set the new target coordinates x = 556 y = 481 # Move the mouse to the new location (x, y, duration=0.5) # Wait for 1 second (1) # Make a mouse click () # Wait for the web browser window to open (1) # Read the text from the file with open(’D:\\backgrund\\python\\’, ’r’) as file: text = () # Extract the first 40 words from the text words = () first_40_words = ’ ’.join(words[:40]) # Type the first 40 words and press Enter (first_40_words, interval=0.1) # Write the text with a specified interval (“enter“) (“enter“) (““, interval=0.1) # Wait for the typing to complete # Scroll down three times scrolls = 5 scroll_amount = 480 # Adjust this value to control the scroll distance for _ in range(scrolls): # Perform the scroll action (-scroll_amount) # Wait a short interval before scrolling again (0.5) # Make a mouse click () # Wait for the web browser window to open (2) # Type the text “thumbnail“ and press Enter (“thumbnail“) (“enter“) # Set the new target coordinates x = 1399 y = 965 # Move the mouse to the new location (x, y, duration=0.5) # Wait for 1 second (1) # Make a mouse click () # Wait for 1 second (1) # Set the new target coordinates x = 745 y = 430 # Move the mouse to the new location (x, y, duration=0.5) # Wait for 1 second (1) # Make a mouse click () # Wait for 1 second (1) # Make a mouse click () # Set the new target coordinates x = 808 y = 526 # Move the mouse to the new location (x, y, duration=0.5) # Wait for 1 second (1) # Make a mouse click () # Set the new target coordinates x = 1399 y = 965 # Move the mouse to the new location (x, y, duration=0.5) # Wait for 1 second (1) # Make a mouse click () # Set the new target coordinates x = 622 y = 909 # Move the mouse to the new location (x, y, duration=0.5) # Wait for 1 second (1) # Scroll down three times scrolls = 2 scroll_amount = 3600 # Adjust this value to control the scroll distance for _ in range(scrolls): # Perform the scroll action (-scroll_amount) # Wait a short interval before scrolling again (0.5) # Wait for 1 second (1) # Make a mouse click () # Set the new target coordinates x = 1216 y = 449 # Move the mouse to the new location (x, y, duration=0.5) # Wait for 1 second (1) # Make a mouse click () # Set the new target coordinates x = 1399 y = 965 # Move the mouse to the new location (x, y, duration=0.5) # Wait for 1 second (1) # Make a mouse click () # Set the new target coordinates x = 1337 y = 782 # Move the mouse to the new location (x, y, duration=0.5) # Wait for 1 second (2) # Make a mouse click () # Set the new target coordinates x = 633 y = 387 # Move the mouse to the new location (x, y, duration=0.5) # Wait for 1 second (2) # Make a mouse click () # Set the new target coordinates x = 1385 y = 231 # Move the mouse to the new location (x, y, duration=0.5) # Wait for 1 second (1) # Make a mouse click ()
Back to Top