Comments (12)
Works like a charm! Thanks a lot!
from pytr.
Please use the issue template
from pytr.
Is your username really name
? This could cause Python to interpret the first character of your username \n
as an escape sequence for a new line. See https://stackoverflow.com/a/52239952
@marzzzello I would recomend using Pathlib, that should handle such cases without errors.
from pytr.
I tested it with the username name
and it worked without a problem. So you need to give us more informations :D
from pytr.
Hi, I've got the same FileNotFoundError on practically the same document (with a different date in the filename).
Every time I run the script, it continued to download a bunch more files (even if the gathered list seems to be the same every time). After about 5 executions, it seems to have downloaded all files (338 files) - except the one Terms of service file.
Strangely I can't find the document in the file list in the TR-app (at least not at the timestamp given from the documents name).
What else of information would be helpful?
Greetings!
from pytr.
I think the problem is the space at the end of Terms of service - credit cards and wallets
. Windows probably doesn't like this path. I'll look into a fix. On Linux it should work anyway
from pytr.
@omegao @Tapsel99 please check if version 0.0.14 0.0.15 fixes the issue
from pytr.
Hi @marzzzello, thanks for looking into that issue!
I've just upgraded to 0.0.16 and tried again, but fails already with the very first file:
13:32:22 Received #9 (last) timeline
13:32:22 1/264: Basisinformationen -- Mi. 06.05. um 09:02 Uhr (Europe/Berlin)
Traceback (most recent call last):
File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\Scripts\pytr.exe\__main__.py", line 7, in <module>
File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\lib\site-packages\pytr\main.py", line 130, in main
asyncio.get_event_loop().run_until_complete(dl.dl_loop())
File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 641, in run_until_complete
return future.result()
File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\lib\site-packages\pytr\dl.py", line 49, in dl_loop
await self.tl.timelineDetail(response, self, max_age_timestamp=self.since_timestamp)
File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\lib\site-packages\pytr\utils.py", line 237, in timelineDetail
dl.dl_doc(doc, response['titleText'], response['subtitleText'])
File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\lib\site-packages\pytr\dl.py", line 98, in dl_doc
filepath = sanitize_filepath(filepath, '_', os_name)
File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\lib\site-packages\pathvalidate\_filepath.py", line 448, in sanitize_filepath
).sanitize(file_path, replacement_text)
File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\lib\site-packages\pathvalidate\_filepath.py", line 84, in sanitize
self.__fpath_validator.validate_abspath(value)
File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\lib\site-packages\pathvalidate\_filepath.py", line 255, in validate_abspath
raise err_object
pathvalidate.error.ValidationError: reason=MALFORMED_ABS_PATH, target-platform=universal, description=an invalid absolute file path (c:\tmp\Basisinformationen über Wertpapiere\2020-05-06 0902 Basisinformationen.pdf) for the platform (universal). to avoid the error, specify an appropriate platform correspond with the path format, or 'auto'.
I've tried with different paths and with/without quotes... no change :|
from pytr.
i have already reinstalled and updated pytr but still without success. I have censored the name with "Name
(base) C:\Users\name\pytr>pytr dl_docs C:\Usersname\Documents\TradeRepublic-Docs
14:23:11 Found credentials file
14:23:11 Phone: +49***********, PIN: ****
14:23:12 Web session resumed
14:23:12 Logged in
14:23:12 Awaiting #1 timeline
14:23:12 Connecting to websocket ...
14:23:12 Connected to websocket ...
14:23:12 Received #1 timeline, awaiting #2 timeline
14:23:12 Received #2 timeline, awaiting #3 timeline
14:23:12 Received #3 timeline, awaiting #4 timeline
14:23:12 Received #4 timeline, awaiting #5 timeline
14:23:12 Received #5 timeline, awaiting #6 timeline
14:23:12 Received #6 (last) timeline
14:23:13 1/162: Deine Unterlagen -- Di. 29.12. um 14:12 Uhr (Europe/Berlin)
Traceback (most recent call last):
File "C:\Usersname\miniconda3\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Usersname\miniconda3\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Usersname\miniconda3\Scripts\pytr.exe\__main__.py", line 7, in <module>
File "C:\Users\knamearla\miniconda3\lib\site-packages\pytr\main.py", line 130, in main
asyncio.get_event_loop().run_until_complete(dl.dl_loop())
File "C:\Usersname\miniconda3\lib\asyncio\base_events.py", line 642, in run_until_complete
return future.result()
File "C:\Usersname\miniconda3\lib\site-packages\pytr\dl.py", line 49, in dl_loop
await self.tl.timelineDetail(response, self, max_age_timestamp=self.since_timestamp)
File "C:\Usersname\miniconda3\lib\site-packages\pytr\utils.py", line 237, in timelineDetail
dl.dl_doc(doc, response['titleText'], response['subtitleText'])
File "C:\Usersname\miniconda3\lib\site-packages\pytr\dl.py", line 98, in dl_doc
filepath = sanitize_filepath(filepath, '_', os_name)
File "C:\Usersname\miniconda3\lib\site-packages\pathvalidate\_filepath.py", line 442, in sanitize_filepath
return FilePathSanitizer(
File "C:\Usersname\miniconda3\lib\site-packages\pathvalidate\_filepath.py", line 84, in sanitize
self.__fpath_validator.validate_abspath(value)
File "C:\Usersname\miniconda3\lib\site-packages\pathvalidate\_filepath.py", line 255, in validate_abspath
raise err_object
pathvalidate.error.ValidationError: reason=MALFORMED_ABS_PATH, target-platform=universal, description=an invalid absolute file path (C:\Usersname\Documents\TradeRepublic-Docs\Kundenvereinbarung\Du und Trade Republic, ein Spitzenteam 1412 Deine Unterlagen.pdf) for the platform (universal). to avoid the error, specify an appropriate platform correspond with the path format, or 'auto'.
from pytr.
@Tapsel99 I found the problem, please checkout version 0.0.17
PS: format code with 3 backticks (I've done it for you now):
```
code
```
from pytr.
Another error 😨
14:36:47 1/264: Basisinformationen -- Mi. 06.05. um 09:02 Uhr (Europe/Berlin)
Traceback (most recent call last):
File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\Scripts\pytr.exe\__main__.py", line 7, in <module>
File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\lib\site-packages\pytr\main.py", line 130, in main
asyncio.get_event_loop().run_until_complete(dl.dl_loop())
File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 641, in run_until_complete
return future.result()
File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\lib\site-packages\pytr\dl.py", line 48, in dl_loop
await self.tl.timelineDetail(response, self, max_age_timestamp=self.since_timestamp)
File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\lib\site-packages\pytr\utils.py", line 237, in timelineDetail
dl.dl_doc(doc, response['titleText'], response['subtitleText'])
File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\lib\site-packages\pytr\dl.py", line 87, in dl_doc
if os_name == 'nt':
NameError: name 'os_name' is not defined
Should I restart anything after the upgrade or something like that?
from pytr.
Sorry I'm stupid please use 0.0.18
from pytr.
Related Issues (20)
- Filenames - Windows compatible HOT 2
- Customize timeformat in filenames HOT 4
- Exception when get details for BMW
- Bad Request Messages HOT 5
- Unkown_Error on download documents HOT 1
- BAD_SUBSCRIPTION_TYPE error for pytr portfolio HOT 17
- Session is not invalidated when a new login with different number occurs HOT 2
- last_days command seems to have no effect HOT 4
- Not all Filess Included HOT 3
- ValueError: Connection Error: failed 29 Segmentation fault after dl_docs HOT 20
- pytr dl_docs --last_days 7 docs does not DL PDF, although they are there (checked online with TR) HOT 2
- Crypto gets timeout HOT 8
- Connection Error on dl_docs HOT 1
- ValueError: Connection Error: failed 31 HOT 5
- problem with --last_days reproducable
- Support for Visa Card transactions HOT 9
- Provide pre-build binaries HOT 1
- Export investments as CSV HOT 1
- pytr portfolio gets stuck while unsubscribeing HOT 4
- pytr portfolio stuck after connected to websocket HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytr.