Giter Club home page Giter Club logo

smugcli's People

Contributors

durin42 avatar graveljp avatar idc101 avatar jlrgraham avatar tirkarthi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

smugcli's Issues

Quiet mode ?

Hi,
I was wondering if it would be possible to add a "quiet/shy" mode so it doesn't ask if you want to proceed with the sync and just does it . Handy if you have sync running as a cron job .

Merci beaucoup

Sync deletions & renamed files/folders

Would it be possible to sync deletions/name alterations?

I'd really like to keep a 1:1 match between my local folder and the smugmug destination. Currently this isn't possible. Any previously uploaded content remains on smugmug even if it has been removed from the source.

I realize not everyone would want this behavior, but it would be a good option for those of us who want to achieve a true one way sync.

Folder path

Before:
./smugcli.py sync /absolute/path/to/folderA -t Pics
folderA will be a subfolder of Pics

Now:
./smugcli.py sync /absolute/path/to/folderA -t Pics
/absolute/path/to/folderA will be a subfolder of Pics, which is prone to go over SmugMug limit.

Syncing a large folder: Reliability and logging

I am syncing a large folder (15k subfolders/galleries and 700k photos).
One thing I have noticed: smugcli ignores a lot of subfolders (e.g., sync a folder containing 4420 subfolders). I have to rerun the program many times (it still has not fully synced this folder yet) and there is no clues about what happened because of lacking a logging mechanism.

login error : AttributeError: 'Thread' object has no attribute 'isAlive'

I am getting this error when trying to login .
Any clues ?


Started local server.
Visit http://localhost:63983/ to grant SmugCli access to your SmugMug account.
Opening page in default browser...
Traceback (most recent call last):
File "/usr/local/bin/smugcli", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.9/site-packages/smugcli/smugcli.py", line 299, in main
run(sys.argv[1:])
File "/usr/local/lib/python3.9/site-packages/smugcli/smugcli.py", line 291, in run
parsed.func(parsed)
File "/usr/local/lib/python3.9/site-packages/smugcli/smugcli.py", line 59, in
login_parser.set_defaults(func=lambda a: fs.smugmug.login((a.key, a.secret)))
File "/usr/local/lib/python3.9/site-packages/smugcli/smugmug.py", line 383, in login
self.config['access_token'] = self.service.request_access_token()
File "/usr/local/lib/python3.9/site-packages/smugcli/smugmug_oauth.py", line 71, in request_access_token
while thread.isAlive():
AttributeError: 'Thread' object has no attribute 'isAlive'

Improvement: SmugMug limits

SM has a limit of "5000" on everything: 5000 subfolders per folder, 5000 galleries per folder, 5000 pictures per gallery, etc. Furthermore, it can only contain folder trees that go five folders deep (SmugMug API). It seems smugcli does not check those limits before uploading, which results in errors or ignoring folders/pictures.
The SM web uploader does check those limits: it does not allow uploading if one of those limits is violated.

Feature Request: Multithreaded Uploads

I have a pretty good network connection and 6 million photos (yep!) to upload to SM.
Multithreaded uploads would help greatly.
Well, this feature is big and complicated...

Album creation error

Hi There,

I'm using the tool in a batch script file, getting the error below.
Can't figure out why the album creation fails.
Can some of you point me in the right direction?

Thanks in advance!!

"C:\dslrBooth\ontwikkeld\1604-RAY^&\" 1604-RAY& Press any key to continue . . . "1604-RAY^&" 1604-RAY& Press any key to continue . . . ECHO is off. Combined path: Photobooths\2023\1604-RAY& Creating Album "Photobooths\2023\1604-RAY&". Traceback (most recent call last): File "C:\Users\Bert\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\Bert\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Users\Bert\AppData\Local\Programs\Python\Python39\lib\site-packages\smugcli\__main__.py", line 4, in <module> smugcli.main() File "C:\Users\Bert\AppData\Local\Programs\Python\Python39\lib\site-packages\smugcli\smugcli.py", line 310, in main run(sys.argv[1:]) File "C:\Users\Bert\AppData\Local\Programs\Python\Python39\lib\site-packages\smugcli\smugcli.py", line 302, in run parsed.func(parsed) File "C:\Users\Bert\AppData\Local\Programs\Python\Python39\lib\site-packages\smugcli\smugcli.py", line 118, in <lambda> func=lambda a, t=node_type: fs.make_node(a.user, a.path, a.p, t, File "C:\Users\Bert\AppData\Local\Programs\Python\Python39\lib\site-packages\smugcli\smugmug_fs.py", line 167, in make_node self._match_or_create_nodes( File "C:\Users\Bert\AppData\Local\Programs\Python\Python39\lib\site-packages\smugcli\smugmug_fs.py", line 102, in _match_or_create_nodes all_nodes.append(all_nodes[-1].get_or_create_child(dir, params)) File "C:\Users\Bert\AppData\Local\Programs\Python\Python39\lib\site-packages\smugcli\smugmug.py", line 292, in get_or_create_child return self._create_child_node(name, params) File "C:\Users\Bert\AppData\Local\Programs\Python\Python39\lib\site-packages\smugcli\smugmug.py", line 253, in _create_child_node raise UnexpectedResponseError( smugcli.smugmug.UnexpectedResponseError: Error creating node "1604-RAY&". Server responded with status code 409: Conflict. Album not found: "Photobooths\2023\1604-RAY&".

Can't create folders or albums: "User has not granted the required permissions"

Any ideas? Same error for mkalbum and mkdir.

$ smugcli mkalbum --privacy unlisted Family/2021/
Creating Album "Family/2021".
Traceback (most recent call last):
  File "/home/firecat53/.local/bin/smugcli", line 8, in <module>
    sys.exit(main())
  File "/home/firecat53/.local/lib/python3.9/site-packages/smugcli/smugcli.py", line 310, in main
    run(sys.argv[1:])
  File "/home/firecat53/.local/lib/python3.9/site-packages/smugcli/smugcli.py", line 302, in run
    parsed.func(parsed)
  File "/home/firecat53/.local/lib/python3.9/site-packages/smugcli/smugcli.py", line 118, in <lambda>
    func=lambda a, t=node_type: fs.make_node(a.user, a.path, a.p, t,
  File "/home/firecat53/.local/lib/python3.9/site-packages/smugcli/smugmug_fs.py", line 167, in make_node
    self._match_or_create_nodes(
  File "/home/firecat53/.local/lib/python3.9/site-packages/smugcli/smugmug_fs.py", line 102, in _match_or_create_nodes
    all_nodes.append(all_nodes[-1].get_or_create_child(dir, params))
  File "/home/firecat53/.local/lib/python3.9/site-packages/smugcli/smugmug.py", line 292, in get_or_create_child
    return self._create_child_node(name, params)
  File "/home/firecat53/.local/lib/python3.9/site-packages/smugcli/smugmug.py", line 253, in _create_child_node
    raise UnexpectedResponseError(
smugcli.smugmug.UnexpectedResponseError: Error creating node "2021".
Server responded with status code 401: The user has not granted the required permissions.

Sync, upload, and ls work great.

I don't know if it matters, but my API key was issued back in 2011. ~/.smugcli shows a v2 endpoint: "authuser_uri": "/api/v2/node/7mTW5" so that may be irrelevant. I'm not sure when the v2 API started, but I think it was quite awhile ago...

Video file names are altered during upload

For example, I used smugcli to upload 20200703_200206.mp4 and after upload the filename shown on the website is 20200703_200206_mp4.MP4. This causes both smugcli sync and uploads from the website to upload the video again because the filename doesn't match.

Thanks!

(sorry to spam you with several issues in a row! Useful project!)

Bug: Folder with both images and subfolders

When syncing a folder with both images and subfolders, this program only uploads the images and ignores the subfolders.
The SmugMug web uploader works fine: create a new gallery for the "outside" images and upload the subfolders.

Video syncing

SmugMug stores original copy of image (same hash), but it does mess up with video files.
So, smugcli will re-upload video files when re-syncing.
Well, I do not know of a solution for this. Maybe just a simple name check for video files?

Space in name

Some OSes (Linux at least) allow file/folder names to have space at the end, which would cause an error with SmugMug.
Just trim the names.

Missing file smugcli/version.py

Not sure if it's still a work in progress, but installing from source with pip install -e . fails because smugcli/version.py is missing.

Thanks!

Video sync doesn't always work with modification times

There's an issue with the video file syncing based on the modification times. The threshold is 1 second between modifications times, but I have a lot of files that have been untouched for years and continually get deleted and reuploaded because there's a >1 sec difference between the metadata values grabbed for modification times. There's always that difference, no matter how many times it gets re-uploaded.

In addition, hachoir-metadata is detecting the modification date as 1946 for a number of my video files that have a 2012 date. Other tools like exiftool correctly extract the modification date. Hachoir also is unmaintained and should probably be replaced by another library such as ffmpeg-python.

Would it be possible to add keywords when uploading?

Hello,

Would it be possible to upload keywords stored in a .json sidecar at the same time as uploading the photo itself?

I would try to do it myself but I have zero knowledge of python.

I manage my photos in Linux with digiKam and I can extract keywords from its database into json sidecars, and I would like to have them in smugmug, too. I checked the API and it seems you can add keywords when you upload a file.

Thanks

Problems with Albums that have a "/" in the name

I have the following Folder containing Albums on my SmugMug account:

$ smugcli.py ls '2009/04'
Will's Basketball Project
Washington D.C.
5/6 Lax vs Scarsdale
Freshman Lacrosse vs Mahopac
Freshman Lacrosse vs Suffern
Doug warming up

When I try to list the contents of the "5/6 Lax vs Scarsdale" album, I don't see a way to escape the slash:

$ smugcli.py ls '2009/04/5/6 Lax vs Scarsdale'
"5" not found in "/2009/04".
$ smugcli.py ls '2009/04/5\/6 Lax vs Scarsdale'
"5\" not found in "/2009/04".
$ smugcli.py ls "2009/04/5\/6 Lax vs Scarsdale"
"5\" not found in "/2009/04".
$ smugcli.py ls "2009/04/5\\/6 Lax vs Scarsdale"
"5\" not found in "/2009/04".

Any suggestions outside renaming my albums (which is most likely what I am going to end up doing).

Return 409 when syncing large folder

It failed to sync many folders when their parent folder has more than 200 entries because of paging (count=100000 does not work. Only returns max 200 entries).

The program is quite nice. Maybe the only one can recursively sync from local to remote for SmugMug. Just need more testing.
Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.