Git Product home page Git Product logo

Comments (12)

omegao avatar omegao commented on June 17, 2024 1

Works like a charm! Thanks a lot!

from pytr.

marzzzello avatar marzzzello commented on June 17, 2024

Please use the issue template

from pytr.

C0D3D3V avatar C0D3D3V commented on June 17, 2024

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.

C0D3D3V avatar C0D3D3V commented on June 17, 2024

I tested it with the username name and it worked without a problem. So you need to give us more informations :D

from pytr.

omegao avatar omegao commented on June 17, 2024

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.

marzzzello avatar marzzzello commented on June 17, 2024

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.

marzzzello avatar marzzzello commented on June 17, 2024

@omegao @Tapsel99 please check if version 0.0.14 0.0.15 fixes the issue

from pytr.

omegao avatar omegao commented on June 17, 2024

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.

Tapsel99 avatar Tapsel99 commented on June 17, 2024

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.

marzzzello avatar marzzzello commented on June 17, 2024

@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.

omegao avatar omegao commented on June 17, 2024

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.

marzzzello avatar marzzzello commented on June 17, 2024

Sorry I'm stupid please use 0.0.18

from pytr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.