@@ -66,17 +66,19 @@ def load_history(self):
66
66
self .log .info ('Created history file' )
67
67
68
68
async def dl_loop (self ):
69
- await self .tl .get_next_timeline (max_age_timestamp = self .since_timestamp )
69
+ await self .tl .get_next_timeline_transactions (max_age_timestamp = self .since_timestamp )
70
70
71
71
while True :
72
72
try :
73
73
_subscription_id , subscription , response = await self .tr .recv ()
74
74
except TradeRepublicError as e :
75
75
self .log .fatal (str (e ))
76
76
77
- if subscription ['type' ] == 'timeline' :
78
- await self .tl .get_next_timeline (response , max_age_timestamp = self .since_timestamp )
79
- elif subscription ['type' ] == 'timelineDetail' :
77
+ if subscription ['type' ] == 'timelineTransactions' :
78
+ await self .tl .get_next_timeline_transactions (response , max_age_timestamp = self .since_timestamp )
79
+ elif subscription ['type' ] == 'timelineActivityLog' :
80
+ await self .tl .get_next_timeline_activity_log (response , max_age_timestamp = self .since_timestamp )
81
+ elif subscription ['type' ] == 'timelineDetailV2' :
80
82
await self .tl .timelineDetail (response , self , max_age_timestamp = self .since_timestamp )
81
83
else :
82
84
self .log .warning (f"unmatched subscription of type '{ subscription ['type' ]} ':\n { preview (response )} " )
@@ -86,17 +88,26 @@ def dl_doc(self, doc, titleText, subtitleText, subfolder=None):
86
88
send asynchronous request, append future with filepath to self.futures
87
89
'''
88
90
doc_url = doc ['action' ]['payload' ]
89
-
90
- date = doc ['detail' ]
91
- iso_date = '-' .join (date .split ('.' )[::- 1 ])
91
+ if subtitleText is None :
92
+ subtitleText = ''
93
+
94
+ try :
95
+ date = doc ['detail' ]
96
+ iso_date = '-' .join (date .split ('.' )[::- 1 ])
97
+ except KeyError :
98
+ date = ''
99
+ iso_date = ''
92
100
doc_id = doc ['id' ]
93
101
94
102
# extract time from subtitleText
95
- time = re .findall ('um (\\ d+:\\ d+) Uhr' , subtitleText )
96
- if time == []:
103
+ try :
104
+ time = re .findall ('um (\\ d+:\\ d+) Uhr' , subtitleText )
105
+ if time == []:
106
+ time = ''
107
+ else :
108
+ time = f' { time [0 ]} '
109
+ except TypeError :
97
110
time = ''
98
- else :
99
- time = f' { time [0 ]} '
100
111
101
112
if subfolder is not None :
102
113
directory = self .output_path / subfolder
@@ -141,6 +152,7 @@ def dl_doc(self, doc, titleText, subtitleText, subfolder=None):
141
152
return
142
153
else :
143
154
filepath = filepath_with_doc_id
155
+ doc ['local filepath' ] = str (filepath )
144
156
self .filepaths .append (filepath )
145
157
146
158
if filepath .is_file () is False :
0 commit comments