-
Notifications
You must be signed in to change notification settings - Fork 8
/
InstagramBotDAO.py
76 lines (63 loc) · 2.33 KB
/
InstagramBotDAO.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import config
import uuid
from sqlalchemy import Column, Integer, DateTime, Text, Boolean
class InstagramImageNoRss(config.Base):
__tablename__ = 'instagram_image_norss'
__table_args__ = {'sqlite_autoincrement': True}
id = Column(Text, primary_key=True, default=lambda: uuid.uuid4().hex)
local_path = Column(Text)
local_path_txt = Column(Text)
local_path_json = Column(Text)
comments_path = Column(Text)
geolocation_path = Column(Text)
text_data = Column(Text)
json_data = Column(Text)
comments_data = Column(Text)
geolocation_data = Column(Text)
username = Column(Text)
sended = Column(Boolean)
published = Column(DateTime)
publication_index = Column(Integer)
def __str__(self):
import json
return json.dumps(self.__dict__, default=str)
class InstgaramImageRss(config.Base):
__tablename__ = 'instagram_image_rss'
__table_args__ = {'sqlite_autoincrement': True}
id = Column(Text, primary_key=True, default=lambda: uuid.uuid4().hex)
published = Column(DateTime)
local_name = Column(Text)
local_path = Column(Text)
rss_webstagram_id = Column(Text)
summary = Column(Text)
media_url = Column(Text)
image_hash = Column(Text)
creation_time = Column(DateTime)
link = Column(Text)
sended = Column(Boolean)
username = Column(Text)
def __str__(self):
import json
return json.dumps(self.__dict__, default=str)
class InstagramSubscription(config.Base):
__tablename__ = 'instagram_subscription'
__table_args__ = {'sqlite_autoincrement': True}
id = Column(Text, primary_key=True, default=lambda: uuid.uuid4().hex)
username = Column(Text, primary_key=True, unique=True)
last_check_datetime = Column(DateTime)
subscribed = Column(Boolean)
def __str__(self):
import json
return json.dumps(self.__dict__, default=str, indent=4)
class Chat(config.Base):
__tablename__ = 'chats'
__table_args__ = {'sqlite_autoincrement': True}
id = Column(Text, primary_key=True, default=lambda: uuid.uuid4().hex)
chat_id = Column(Integer)
admin = Column(Boolean)
tg_ans = Column(Text)
def __str__(self):
import json
return json.dumps(self.__dict__, default=str, indent=4)
#InstagramImageNoRss.__table__.drop()
config.Base.metadata.create_all(config.engine)