Chary Ev2geny wrote:
> ------=_Part_25206_1486381894.1746858220285
> Content-Type: multipart/alternative;
> boundary="----=_Part_25207_336956640.1746858220285"
>
> ------=_Part_25207_336956640.1746858220285
> Content-Type: text/plain; charset="UTF-8"
> Content-Transfer-Encoding: quoted-printable
Thank you! It seems to be back to working now again. :)
fin
> I have created a PR <
https://github.com/beancount/beanprice/pull/108> which=
>=20
> fixes this (at least it works for me)
>
> Until the PR is accepted one can try it by installing my code like this=20
>
> pip install git+
https://github.com/Ev2geny/beanprice.git@issue_106
>
> On Friday, May 9, 2025 at 2:16:48=E2=80=AFPM UTC+2 Chary Ev2geny wrote:
>
>> I also found that it does work with curl_cffi
>>
>> I opened an issue <
https://github.com/beancount/beanprice/issues/106>on=
>=20
>> github with my findings
>>
>> However I found out that it takes bit more than just changing, in yahoo.p=
> y:
>>
>> self.session =3D requests.Session()
>>
>> to:
>>
>> from curl_cffi import requests as curl_requests
>> self.session =3D curl_requests.Session(impersonate=3D"chrome")
>>
>> Because it such a simple replacement one gets an error
>>
>>
>> File "C:\_code\py\beanprice\beanprice\sources\yahoo.py", line 97, in=20
>> get\_price\_series
>> result =3D parse\_response(response)
>> ^^^^^^^^^^^^^^^^^^^^^^^^
>> File "C:\_code\py\beanprice\beanprice\sources\yahoo.py", line 42, in=20
>> parse\_response
>> if response.status\_code !=3D requests.codes.ok:
>> ^^^^^^^^^^^^^^
>> AttributeError: module 'curl\_cffi.requests' has no attribute 'codes'. Di=
> d=20
>> you mean: 'models'?
>>
>> =EE=97=93
>>
>> On Friday, May 9, 2025 at 1:24:33=E2=80=AFPM UTC+2
adrian...@gmail.com wr=
> ote:
>>
>>> The patch is basically changing, in yahoo.py:
>>>
>>> self.session =3D requests.Session()
>>>
>>> to:
>>>
>>> from curl_cffi import requests as curl_requests
>>> self.session =3D curl_requests.Session(impersonate=3D"chrome")
>>>
>>> On Fri, May 9, 2025 at 9:37=E2=80=AFAM Adrian Utrilla <adrian...@gmail.c=
> om>=20
>>> wrote:
>>>
>>>> I've fixed it (uglily) by using
https://github.com/lexiforest/curl_cffi=
>=20
>>>> instead of requests.
>>>>
>>>> On Fri, May 9, 2025 at 9:32=E2=80=AFAM 'Alen =C5=A0iljak' via Beancount=
> <
>>>>
bean...@googlegroups.com> wrote:
>>>>
>>>>> Yes, I recently started getting=20
>>>>> ```
>>>>> Received a non-success status: 429 Too Many Requests
>>>>> ```
>>>>> from Yahoo with my pricedb tool (
>>>>>
https://github.com/alensiljak/pricedb-rust). Another round of=20
>>>>> tightening, I assume. Or, perhaps, an API change?
>>>>>
>>>>> On Friday, 9 May 2025 at 12:34:34=E2=80=AFam UTC+2 fin wrote:
>>>>>
>>>>>> Chary Ev2geny wrote:=20
>>>>>> >=20
>>>>>> > I also getting similar errors:=20
>>>>>> ...=20
>>>>>>
>>>>>> Thanks for verifying it isn't just me. :)=20
>>>>>>
>>>>>>
>>>>>> fin=20
>>>>>>
>>>>>> --=20
>>>>> You received this message because you are subscribed to the Google=20
>>>>> Groups "Beancount" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send=
>=20
>>>>> an email to
beancount+...@googlegroups.com.
>>>>> To view this discussion visit=20
>>>>>
https://groups.google.com/d/msgid/beancount/20bb44dc-01d4-4e43-826c-7c=
> e082a1823en%
40googlegroups.com=20
>>>>> <
https://groups.google.com/d/msgid/beancount/20bb44dc-01d4-4e43-826c-7=
> ce082a1823en%
40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter>
>>>>> .
>>>>>
>>>>
>
> --=20
> You received this message because you are subscribed to the Google Groups "=
> Beancount" group.
> To unsubscribe from this group and stop receiving emails from it, send an e=
> mail to
beancount+...@googlegroups.com.
> To view this discussion visit
https://groups.google.com/d/msgid/beancount/c=
> f27dd5a-b520-4068-85a2-8168664124ecn%
40googlegroups.com.
>
> ------=_Part_25207_336956640.1746858220285
> Content-Type: text/html; charset="UTF-8"
> Content-Transfer-Encoding: quoted-printable
>
> I have created a <a href=3D"
https://github.com/beancount/beanprice/pull/108=
> ">PR</a> which fixes this (at least it works for me)<br /><br />Until the P=
> R is accepted one can try it by installing my code like this <br /><br />pi=
> p install git+
https://github.com/Ev2geny/beanprice.git@issue_106<br /><br /=
>><div class=3D"gmail_quote"><div dir=3D"auto" class=3D"gmail_attr">On Frida=
> y, May 9, 2025 at 2:16:48=E2=80=AFPM UTC+2 Chary Ev2geny wrote:<br/></div><=
> blockquote class=3D"gmail_quote" style=3D"margin: 0 0 0 0.8ex; border-left:=
> 1px solid rgb(204, 204, 204); padding-left: 1ex;">I also found that it doe=
> s work with=C2=A0
>
><span style=3D"box-sizing:border-box;font-family:ui-monospace,SFMono-Regula=
> r,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;=
> font-size:11.9px;margin-top:0px;margin-bottom:0px;padding:16px;overflow:aut=
> o;line-height:1.45;color:rgb(31,35,40);background-color:rgb(246,248,250);bo=
> rder-radius:6px;word-break:normal;min-height:52px"><span style=3D"box-sizin=
> g:border-box">curl_cffi<br></span> </span><br>I opened an <a href=3D"https:=
> //
github.com/beancount/beanprice/issues/106" target=3D"_blank" rel=3D"nofol=
> low" data-saferedirecturl=3D"
https://www.google.com/url?hl=3Den&q=3Dhtt=
> ps://
github.com/beancount/beanprice/issues/106&source=3Dgmail&ust=
>=3D1746944590497000&usg=3DAOvVaw1edRIJZZiQLQhdLYK0tiV5">issue </a>on gi=
> thub with my findings<br><br><div>However I found out that it takes bit mor=
> e than just changing, in yahoo.py:</div><div style=3D"display:flex"><div st=
> yle=3D"min-width:0px"><div role=3D"region" aria-labelledby=3D"c542" style=
>=3D"margin:12px 0px;overflow:auto;padding-right:20px"><div dir=3D"ltr"></di=
> v></div></div></div><div style=3D"display:flex"><div style=3D"min-width:0px=
> "><div role=3D"region" aria-labelledby=3D"c542" style=3D"margin:12px 0px;ov=
> erflow:auto;padding-right:20px"><div dir=3D"ltr"><div><br></div><div><font =
> face=3D"monospace">self.session =3D requests.Session()</font><br></div><div=
>><br></div><div>to:</div><div><br></div><div><font face=3D"monospace">from =
> curl_cffi import requests as curl_requests<br>self.session =3D curl_request=
> s.Session(impersonate=3D"chrome")</font><br></div><div><font face=
>=3D"monospace"><br></font></div></div></div></div></div><div style=3D"displ=
> ay:flex"><div style=3D"min-width:0px"><div role=3D"region" aria-labelledby=
>=3D"c542" style=3D"margin:12px 0px;overflow:auto;padding-right:20px"><div d=
> ir=3D"ltr"><div><font face=3D"monospace">Because it such a simple replaceme=
> nt one gets an error</font></div><div><font face=3D"monospace"><br></font><=
> /div><div><font face=3D"monospace"><br></font></div><div><font face=3D"Cour=
> ier New">File "C:\_code\py\beanprice\beanprice\sources\yahoo.py",=
> line 97, in get\_price\_series<br>result =3D parse\_response(response)<br>=
> ^^^^^^^^^^^^^^^^^^^^^^^^<br>File "C:\_code\py\beanprice\beanprice\sour=
> ces\yahoo.py", line 42, in parse\_response<br>if response.status\_code=
> !=3D requests.codes.ok:<br>^^^^^^^^^^^^^^<br>AttributeError: module 'c=
> url\_cffi.requests' has no attribute 'codes'. Did you mean: =
> 9;models'?</font></div><div><font face=3D"monospace"><br></font></div><=
> /div><div style=3D"color:rgb(80,0,80)"><div role=3D"button" aria-label=3D"S=
> how trimmed content" aria-expanded=3D"false" style=3D"border:0px;border-rad=
> ius:5.5px;display:inline-block;min-height:11px;outline:none;overflow:hidden=
> ;text-align:center;width:24px;color:rgb(95,99,104);background-color:rgb(232=
> ,234,237);margin:8px 0px;opacity:0.7"><div style=3D"background-size:cover;o=
> pacity:0;background-image:radial-gradient(circle farthest-side,rgba(95,99,1=
> 04,0.16),rgba(95,99,104,0.16) 80%,rgba(95,99,104,0) 100%)"></div><span styl=
> e=3D"display:flex;min-height:10.9943px;width:23.9915px"><span style=3D"disp=
> lay:flex"><span aria-hidden=3D"true" style=3D"font-family:"Material Ic=
> ons Extended";font-size:20px;line-height:1;display:inline-block;direct=
> ion:ltr;font-feature-settings:"liga";color:rgb(32,33,36)">=EE=97=
>=93</span></span></span></div></div></div></div></div><div><div style=3D"ma=
> rgin:12px;border-radius:12px;border:1px solid rgb(232,234,237)"><span style=
>=3D"width:1405.94px;min-height:465.724px;display:flex;box-sizing:border-box=
> "><div><div style=3D"color:rgb(60,64,67);font-family:Roboto,Arial,sans-seri=
> f;padding:10px 16px;width:1405.94px;border-bottom:1px solid rgb(232,234,237=
> );box-sizing:border-box;display:flex;min-height:47px"><div style=3D"display=
>:flex;line-height:24px;overflow:hidden"><br></div></div></div></span></div>=
></div><div class=3D"gmail_quote"><div dir=3D"auto" class=3D"gmail_attr">On =
> Friday, May 9, 2025 at 1:24:33=E2=80=AFPM UTC+2 <a href data-email-masked r=
> el=3D"nofollow">
adrian...@gmail.com</a> wrote:<br></div><blockquote class=
>=3D"gmail_quote" style=3D"margin:0 0 0 0.8ex;border-left:1px solid rgb(204,=
> 204,204);padding-left:1ex"><div dir=3D"ltr">The patch is basically changing=
> , in yahoo.py:<div><br></div><div><font face=3D"monospace">self.session =3D=
> requests.Session()</font><br></div><div><br></div><div>to:</div><div><br><=
> /div><div><font face=3D"monospace">from curl_cffi import requests as curl_r=
> equests<br>self.session =3D curl_requests.Session(impersonate=3D"chrom=
> e")</font><br></div></div><br><div class=3D"gmail_quote"><div dir=3D"l=
> tr" class=3D"gmail_attr">On Fri, May 9, 2025 at 9:37=E2=80=AFAM Adrian Utri=
> lla <<a rel=3D"nofollow">
adrian...@gmail.com</a>> wrote:<br></div><bl=
> ockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-lef=
> t:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr">I've fi=
> xed it (uglily) by using=C2=A0<a href=3D"
https://github.com/lexiforest/curl=
> _cffi" rel=3D"nofollow" target=3D"_blank" data-saferedirecturl=3D"
https://w=
>
ww.google.com/url?hl=3Den&q=3Dhttps://github.com/lexiforest/curl_cffi&a=
> mp;source=3Dgmail&ust=3D1746944590497000&usg=3DAOvVaw0zBlN5V6sOF9Zk=
> mjy9jNtI">
https://github.com/lexiforest/curl_cffi</a> instead=C2=A0of reque=
> sts.</div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_at=
> tr">On Fri, May 9, 2025 at 9:32=E2=80=AFAM 'Alen =C5=A0iljak' via B=
> eancount <<a rel=3D"nofollow">
bean...@googlegroups.com</a>> wrote:<br=
>></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;=
> border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Yes, I recent=
> ly started getting=C2=A0</div><div>```</div><div>Received a non-success sta=
> tus: 429 Too Many Requests</div><div>```</div><div>from Yahoo with my price=
> db tool (<a href=3D"
https://github.com/alensiljak/pricedb-rust" rel=3D"nofo=
> llow" target=3D"_blank" data-saferedirecturl=3D"
https://www.google.com/url?=
> hl=3Den&q=3Dhttps://
github.com/alensiljak/pricedb-rust&source=3Dgma=
> il&ust=3D1746944590497000&usg=3DAOvVaw1mrs3dkY6-CIvu-RlKaqWD">https=
>://
github.com/alensiljak/pricedb-rust</a>). Another round of tightening, I =
> assume. Or, perhaps, an API change?</div><br><div class=3D"gmail_quote"><di=
> v dir=3D"auto" class=3D"gmail_attr">On Friday, 9 May 2025 at 12:34:34=E2=80=
>=AFam UTC+2 fin wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"=
> margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-lef=
> t:1ex">Chary Ev2geny wrote:
><br>>
><br>> I also getting similar errors:
><br>...
><br>
><br> Thanks for verifying it isn't just me. :)
><br>
><br>
><br> fin
><br>
><br></blockquote></div>
>
><p></p>
>
> -- <br>
> You received this message because you are subscribed to the Google Groups &=
> quot;Beancount" group.<br>
> To unsubscribe from this group and stop receiving emails from it, send an e=
> mail to <a rel=3D"nofollow">
beancount+...@googlegroups.com</a>.<br>
> To view this discussion visit <a href=3D"
https://groups.google.com/d/msgid/=
> beancount/20bb44dc-01d4-4e43-826c-7ce082a1823en%
40googlegroups.com?utm_medi=
> um=3Demail&utm_source=3Dfooter" rel=3D"nofollow" target=3D"_blank" data=
> -saferedirecturl=3D"
https://www.google.com/url?hl=3Den&q=3Dhttps://grou=
>
ps.google.com/d/msgid/beancount/20bb44dc-01d4-4e43-826c-7ce082a1823en%2540g=
>
ooglegroups.com?utm_medium%3Demail%26utm_source%3Dfooter&source=3Dgmail=
> &ust=3D1746944590497000&usg=3DAOvVaw1peL0pH6LnSJx4PsXoWS9R">https:/=
> /
groups.google.com/d/msgid/beancount/20bb44dc-01d4-4e43-826c-7ce082a1823en%=
>
40googlegroups.com</a>.<br>
></blockquote></div>
></blockquote></div>
></blockquote></div></blockquote></div>
>
><p></p>
>
> -- <br />
> You received this message because you are subscribed to the Google Groups &=
> quot;Beancount" group.<br />
> To unsubscribe from this group and stop receiving emails from it, send an e=
> mail to <a href=3D"mailto:
beancount+...@googlegroups.com">beancount=
> +
unsub...@googlegroups.com</a>.<br />
> To view this discussion visit <a href=3D"
https://groups.google.com/d/msgid/=
> beancount/cf27dd5a-b520-4068-85a2-8168664124ecn%
40googlegroups.com?utm_medi=
> um=3Demail&utm_source=3Dfooter">
https://groups.google.com/d/msgid/beancount=
> /cf27dd5a-b520-4068-85a2-8168664124ecn%
40googlegroups.com</a>.<br />
>
> ------=_Part_25207_336956640.1746858220285--
>
> ------=_Part_25206_1486381894.1746858220285--
>