Closed Zolilio closed 8 months ago
I've been dealing with the same error today. Looking forward for the fix 👁️
@Zolilio This bug seems to be at the photo_download_by_url()
within the DownloadPhotoMixin
.
Precisely in the line 90, when the urlparse()
function is called with the url
param of type <class 'pydantic_core._pydantic_core.Url'>
, when the urlparse()
function only accepts its url param with <class 'str'>
type.
So, leaving that line with the url wrapped with str()
, seems to make it work 🙂 (at least it did on my machine!).
fname = urlparse(str(url)).path.rsplit("/", 1)[1]
This is a simple patch I made on my local version of the lib. I hope the maintainers can fix the issue setting up the proper types soon 😁.
Thanks, this works great! I had to also apply this in a similar fashion to video.py and album.py, though. Not sure if that covers all types, but at least that works for me now.
@subzeroid could you have a look if this can be merged?
I tried downloading images from url with a simple code but I got the error "AttributeError: 'pydantic_core._pydantic_core.Url' object has no attribute 'decode'"
The code I used:
Here is the detail traceback: