-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdb.py
27 lines (20 loc) · 847 Bytes
/
db.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import sqlite3
import os
cwd = os.getcwd()
# Create table
def insertData(vidName,vidFileLoc, screenShotFileLoc, vidRoute, screenShotRoute ):
con = sqlite3.connect("video.db")
cur = con.cursor()
cur.execute("""CREATE TABLE IF NOT EXISTS videos
(vidName text, vidFileLoc text, screenShotFileLoc text, vidRoute text, screenShotRoute text )""")
cur.execute(f'INSERT INTO videos VALUES ("{vidName}","{vidFileLoc}","{screenShotFileLoc}", "{vidRoute}" , "{screenShotRoute}")')
con.commit()
con.close()
def insertCodec(vidCode,audCode):
con = sqlite3.connect("codec.db")
cur = con.cursor()
cur.execute("""CREATE TABLE IF NOT EXISTS codecs
(vidCodec text, audioCodec text)""")
cur.execute(f'INSERT INTO codecs VALUES ("{vidCode}","{audCode}")')
con.commit()
con.close()