Created
January 18, 2023 01:33
-
-
Save mcoliver/c3586e9dec7a6fb59ee81c14f9c2674b to your computer and use it in GitHub Desktop.
migrate cinesync v4 to v5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import uuid | |
import time | |
from selenium import webdriver | |
from selenium.webdriver.common.by import By | |
# Download cinesync v4 list by saving the html at https://www.cinesync.com/dashboard | |
# cat cineSync.html | grep c-callout__heading | grep -o -P '(?<=\>).*(?=\<)' | sort | uniq | grep '@' > useraccounts.txt | |
# Run this script once and sign in to set your cinesync login credentials | |
# send an email to the list to have them reset their password @ https://5.cinesync.com/auth/password_reset/ | |
def addUser(username): | |
driver.get(f'{SITE}') | |
username_field = driver.find_element('id', 'id_username') | |
username_field.send_keys(username) | |
email_field = driver.find_element('id', 'id_email') | |
email_field.send_keys(username) | |
pw_field = driver.find_element('id', 'id_password') | |
randpw = str(uuid.uuid4()) | |
pw_field.send_keys(randpw) | |
driver.find_element('id', 'id_is_account_admin').click() | |
driver.find_element(By.XPATH, "//button[@class='btn-rounded' and @type='submit']").click() | |
if __name__ == "__main__": | |
options = webdriver.ChromeOptions() | |
options.add_argument("start-maximized") | |
options.add_argument("user-data-dir=/Users/moliver/Desktop/cinesyncmigrate/chromedir"); | |
driver = webdriver.Chrome(options=options) | |
SITE = "https://5.cinesync.com/dashboard/logins/add/" | |
v4accounts = open('useraccounts.txt', 'r') | |
usernames = v4accounts.readlines() | |
for u in usernames: | |
addUser(u) | |
driver.quit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment