PaulPaulAga

Untitled

Apr 16th, 2021
1,017
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import psycopg2
  2.  
  3. f = open("videos.txt")
  4.  
  5. conn = psycopg2.connect(dbname='netflix', user='redtech',
  6.                         password='red_tech', host='localhost')
  7. c = conn.cursor()
  8. for line in f:
  9.     address, name, id = line.split(";")
  10.     name = name.strip("\n")
  11.     id = int(id)
  12.     print(address, id)
  13.     try:
  14.         cursor.execute("update movie_videos set path = %s where movie_id = %s;", [address, id])
  15.     except:
  16.         print("SUKAAAA")
  17. c.close()
  18. conn.commit()
  19. conn.close()
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×