pytr-org / pytr

Use TradeRepublic in terminal and mass download all documents
https://pypi.org/project/pytr/
MIT License
357 stars 59 forks source link

fixed Code for changed Traderepublic datastructure / fix formating #74

Closed DayAft3r closed 2 days ago

DayAft3r commented 1 week ago

tried the fix #73 and found some more data formating errors like timestamps which are sent as strings now and not as Unixtimestamps (int) anymore.

kellerkind87 commented 1 week ago

is this pr https://github.com/pytr-org/pytr/pull/55 trying to solve the same?

BjBe82 commented 1 week ago

is this pr #55 trying to solve the same?

Yes apparently it is for the same issues, and now it is also merged to master. I can also confirm that the #55 fix is working for me.

kellerkind87 commented 1 week ago

is this pr #55 trying to solve the same?

Yes apparently it is for the same issues, and now it is also merged to master. I can also confirm that the #55 fix is working for me.

same for me. master branch works for me too. besides the nameing of the files. maybe there is something ongoing.

Katzmann1983 commented 1 week ago

Hey, I merged PR 55 and hope this solved the issue. Are there still issues with the file names?

mats58 commented 1 week ago

Info: using TR for 2 years and since April with credit card but no giro

I used this nice tool (pytr) not before this week (using ubuntu in Virtualbox) and had also the mistake described in #71 As workaround I installed the branch from here with pipx install git+https://github.com/DayAft3r/pytr But here I got another error :-( Some analysis of the output (called pytr with debug option and piped the 'error' messages to a file (pytr -v debug dl_docs ./docs 2> cmd_dl_docs.txt) showed, that the error occurred by the entry for the "Zahlung" of 5€ for my credit card on 2024-04-04

utils DEBUG {"id": "5069ead3-6bcc-596a-b481-...XXX", "sections": [{"title": "Du hast 5,00\u00a0\u20ac ausgegeben", "data": {"icon": "logos/bank_traderepublic/v2", "subtitleText": null, "timestamp": "2024-04-04T08:40:25.700+0000", "status": "executed"}, "action": null, "type": "header"}, {"title": "\u00dcbersicht", "data": [{"title": "Status", "detail": {"text": "Completed", "functionalStyle": "EXECUTED", "type": "status"}, "style": "plain"}, {"title": "Zahlung", "detail": {"text": "Cash", "icon": "logos/banktraderepublic/v2", "type": "iconWithText"}, "style": "plain"}], "action": null, "type": "table"}, {"title": "Dokumente", "data": [{"title": "Bestellung Trade Republic Karte", "detail": "04.04.2024", "action": {"type": "browserModal", "payload": "https://traderepublic...XXX"}, "id": "22160d92-7644-5e3b-9a79-...XXX_", "postboxType": "CARD_BILLING_INVOICE"}], "action": null, "type": "documents"}]} Traceback (most recent call last): ... File "/home/user/.local/pipx/venvs/pytr/lib/python3.10/site-packages/pytr/utils.py", line 399, in get_title_text raise RuntimeError('Unable to detect titleText from response') RuntimeError: Unable to detect titleText from response

I just added two lines at line 397 in module _get_titletext of my local file util.py and the download of all (? to be verified) my pdfs worked successfully :-)

                elif data['title'] == 'Zahlung':
                    return 'Zahlung' 

grafik

This may not be the solution for anyone but perhaps they can analyse the error by this proceed...

kellerkind87 commented 1 week ago

Hey, I merged PR 55 and hope this solved the issue. Are there still issues with the file names?

i am trying to run the main branch. but i get errors. In general i guess this PR seems to be superseeded. i will file maybe a new issue for that error.

comparing this PR with master in terms of functionality:

feature master #74
get timeline not working
error in utils.py line 354 comparision of string and number
works
downloading documents partialy working.
only folders - with some local fix: customer agreements, "Dividende Wahlweise, Kapitalmaßnamen and Löschbestätigung
name of files does not always contain the name of the underlay (savings plan, and abrechnung)
acutal: Abrechnung/2024-06-21 Verkauf.pdf expected dldocs/Abrechnung/2024-06-21 Nvidia Verkauf.pdf

@DayAft3r, @Katzmann1983 does it help?

BjBe82 commented 1 week ago

Hey, I merged PR 55 and hope this solved the issue. Are there still issues with the file names?

i am trying to run the main branch. but i get errors. In general i guess this PR seems to be superseeded. i will file maybe a new issue for that error.

comparing this PR with master in terms of functionality: feature master #74 get timeline not working error in utils.py line 354 comparision of string and number works downloading documents partialy working. only folders - with some local fix: customer agreements, "Dividende Wahlweise, Kapitalmaßnamen and Löschbestätigung name of files does not always contain the name of the underlay (savings plan, and abrechnung) acutal: Abrechnung/2024-06-21 Verkauf.pdf expected dldocs/Abrechnung/2024-06-21 Nvidia Verkauf.pdf

@DayAft3r, @Katzmann1983 does it help?

After some tests, I found out that this is related to the "last_days" option on my side. Created a issue for it: https://github.com/pytr-org/pytr/issues/79 . @kellerkind87 are you using the option?

kellerkind87 commented 1 week ago

After some tests, I found out that this is related to the "last_days" option on my side. Created a issue for it: #79 . @kellerkind87 are you using the option?

exactly. #78 is targeting the same. maybe a duplicate?

pgoodbread commented 6 days ago

If I add this code to pytr/utils.py get_title_text(), then it at least fully runs for me and does not raise the error, but the titles are not perfect.

                    else:
                        return data['title']

EDIT: It also does not download paid dividends

Katzmann1983 commented 2 days ago

Ok, closing, since all changes are now in master.