Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues using additional parameters during get_file_info() #75

Closed
MarinBons opened this issue Oct 8, 2021 · 8 comments
Closed

Issues using additional parameters during get_file_info() #75

MarinBons opened this issue Oct 8, 2021 · 8 comments

Comments

@MarinBons
Copy link

Hello ! Thanks for the amazing project :)
I have got some issues using multiple additional parameters while using get_file_info method

Neither :
fl.get_file_info(path,additional = {'size','time','real_path'})
or
fl.get_file_info(path,additional = ['size','time','real_path'])
works.

I only have one parameter working or less, like when I use it this way :
fl.get_file_info(path',additional = 'size')

I only have the results like this, so with only one parameter (size, time, real_path or owner) working
{'data': {'files': [{'additional': {'size': 3342336}, 'isdir': False, 'name': 'file_name', 'path': '/path'}]}, 'success': True}

@N4S4
Copy link
Owner

N4S4 commented Oct 9, 2021

So if i understand correctly, requesting one parameter only it works otherwise it doesn't? Did you tey to leave it = None?

@MarinBons
Copy link
Author

Yes indeed.
I've tried and I get a result without information about size, time, real path or owner 🤷‍♂️

@N4S4
Copy link
Owner

N4S4 commented Oct 10, 2021

Mmm ok I will need to look into it

@AustinAres2007
Copy link

As of May 20th 2022, this still has not been fixed.

@N4S4
Copy link
Owner

N4S4 commented May 20, 2022

True, unfortunately time has not been on my side...I will make some tests

@AustinAres2007
Copy link

AustinAres2007 commented May 20, 2022

True, unfortunately time has not been on my side...I will make some tests

Does it work for others? I am looking at the code and the "additional" parameter is handled differently

A fix I came up with in the get_file_list and get_file_info functions, it is to:

Remove the:

if type(additional) is list:
	additional = ','.join(additional)

part and replace it with:

additional = str(additional).replace("'", '"')

This works for my use case. I believe it is todo with requests.get. It does not seem to like single quotes. And leave additional as a list, but the type is converted to a string. And replace single quotes with double quotes.

Also sorry if I'm not making sense, just 14 and still learning this "trade". Thanks for this package as well, very useful.

@N4S4
Copy link
Owner

N4S4 commented May 21, 2022

Any help and suggestion are always welcome! So thank you! It was working for me when I used couple months ago, however later tonight I will run few tests and see what is going on

@N4S4
Copy link
Owner

N4S4 commented May 21, 2022

So it looks like when it was requested one additional parameter only worked but not if you request more than one, apparently the request type needs to be packed as list string and not processed, however your fix worked! thank you I will update the code

@N4S4 N4S4 closed this as completed May 21, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

No branches or pull requests

3 participants