richq / folders2flickr

Upload files to flickr
Other
102 stars 38 forks source link

Windows? #12

Open jamesholland-uk opened 10 years ago

jamesholland-uk commented 10 years ago

I see this has been resurrected from the old Google Code hosted project? That had a Windows version, is this likely to happen for this updated version of the project? Thanks

richq commented 10 years ago

I can't test a Windows version so it would end up broken. I don't want to get anyone's hopes up by generating an all-in-one executable that is untested. Also have you noticed that all project hosting seems to have removed binary downloads? So having such a file is an added hassle for me.

However, it's all just python so should be cross platform. I've just checked to see the state of pip on Windows, and by all accounts it sucks! The easiest way to test out a Windows version then is like this:

  1. install python 2.x from here - http://www.python.org/download/releases/2.7.6/
  2. download a zip of the repository from https://github.com/richq/folders2flickr/archive/master.zip
  3. unzip it, cd into the directory and somehow run "python folders2flickr"

Step 3 in particular is a bit vague and could probably be improved to be better/more familiar for Windows folk. If that does not work, then report back and I'll see what I can do. The only way a Windows version happens is if people who know help out :-)

MrBovert commented 10 years ago

Did this last weekend and it works quite well with Win7. The only thing was to comment out the two lines with "timestamp" in uploadr.py. The function time.strftime() seems to be different.

Thanks a lot to Richard to reanimate this helpfull tool :-)

richq commented 10 years ago

https://stackoverflow.com/questions/10807164/python-time-formatting-different-in-windows

Aha! The %F is not supported by python, it is an extension. I should stop doing that.

richq commented 10 years ago

I got rid of that strftime stuff, it was a nasty hack of my own doing. I should have used logging properly (which is what it does now). That's the kind of Windows compatibility I can do :)

MrBovert commented 10 years ago

There is one more thing neccessary for Windows I forgot in Line 310:

Linux: images.append( os.path.normpath( dirpath + "/" + f ) ) Windows: images.append( os.path.normpath( dirpath + "\" + f ) )

jamesholland-uk commented 10 years ago

Cool, thanks both. I will download and have a go myself I the next day or two and report back if any issues.

DrMrNo commented 10 years ago

I get these errors when using folders2flicrk in windows:

(<type 'exceptions.KeyError'>, KeyError('MakerNote Tag 0x0001',), <traceback object at 0x0000000003448708>) ('Error:', '3 General upload failure')

I'm trying to use existing Flickr and copied the history file from the original folders2flicrk. Should that work? Any idea what might be the problem?

Btw, it tried to upload an existing picture again, so maybe the previous history file did not work.

richq commented 10 years ago

@DrMrNo - Yep, it should work, I've tried to maintain backwards compatibility with the database.

That KeyError thing looks like a bug in exif.py, which is next on my list of cleaning up - issue #16 has more details. Basically, I want to remove the embedded copy that's in this project and shift to using the updated upstream version. Be that the one in your GNU/Linux distro, the one that pip would pull down or (last resort) one that I could pull from upstream and ship in a release zip.

Apart from that, does the photo upload OK manually? I've seen "Error 3 General upload" failures when flickr itself rejects a file for no good reason. There I've had to edit the EXIF data to fix broken tags, but that was using ancient digital photos before these things were standardized. It's probably uploadable, but just want to make sure and rule out any possible external issues.

DrMrNo commented 10 years ago

@richq - thanks for the quick reply!

Actually those pics were corrupted. My bad that didn't realize this immediately. They were not in the history as the old version was not either able to upload them. The log started now with plenty of errors (there are few dozends old pics out of 50 000 that are corrupted) which did not happen with the previous version.

I'll see whether it'll now go through.

haridsv commented 10 years ago

I am using the cloned version on windows with ActivePython2.6.6.17 and the first time I run, I am told that a browser window will open, but nothing happens.

using uploadr.ini file "D:\Users\hari\uploadr.ini"
Have you authenticated this application? (Y/N): n
You need to allow this program to access your Flickr site.
A web browser should pop open with instructions.
After you have allowed access restart uploadr.py

Is it because it doesn't know how to open a browser on windows? Can we have the URL printed so that we can copy paste and into a browser window?

haridsv commented 10 years ago

OK, I added a print URL in uploader.py right before webbrowser.open(url) call and I was then able to copy paste the URL and get it going.

BTW, I verified by simply calling webbrowser.open("http://google.com") from python shell, that it is broken on my system, so it is not an issue with your code.

richq commented 10 years ago

It could be an issue with Active Python doing something funny - does python -m webbrowser -t "http://www.python.org" work? https://docs.python.org/2/library/webbrowser.html mentions Windows a couple of times and talks about "non-Unix platforms", so it ought to work.