time4tea / gopro-dashboard-overlay

Programs to process GoPro MP4 & Generic GPX/FIT files and create video dashboards & maps

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduce parameter to pass API-key to gopro-rename.py

mishuha opened this issue · comments

"gopro-rename.py --geo" works, but it's really restricted without passing the API-key.
It leads to requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://geocode.xyz/...
As said by https://geocode.xyz/:

There are currently no usage limits but response times on the free ports are normally throttled to no more than 1 request per second for all users combined.

So all un-authenticated users are considered as using a single key

Well, that is true. You can just run the program again though. Unless you have lots of files it will usually work after a few tries.
If you do have loads of files, it would make sense to get an api key.
If there are other services that offer similar capabilities, I'd be happy to integrate them.

Ah - maybe i misunderstood. Even if you had an API key, there is no way to pass it to the program. Yes I see.
Curious: Is this an actual or theoretical problem? Do you have an API key?

I have about a terabyte set of unprocessed files collected for the last years :). If I pass a folder with them as an argument I will get an error on first failed response.

But perhaps it is more theoretical for me. Mostly because of how the files are renamed. They are got timestamps but loosing their original partitioning. Therefore, it is difficult to understand which set of files represents a continuous capture and which are from the other capturing.

Yes, I just got the key and no problems doing direct requests using it. (1 request per second is pay-free)

I would definitely agree that this utility is very basic. I'd welcome a suggestion about how to group and rename files.

There are loads of options... I'm really curious what would be useful for you with so many files.

Before renaming, we know due to the naming which order they are in and which belong together.

It could be that simply creating a folder with the date and location, then moving the files into the folder with the existing name makes sense.

I just created this as an example really of what could be possible.. I have used it quite a lot as-is, but agree it has rough edges!

Or maybe. ... could update mpeg metadata somehow, if possible, with the location (as a place name, not coordinates) rather than rename the file....

The renaming may be useful for cases when date creation of file is lost and it's needed to be added to videoeditor as a list by drag'n'drop. And geodata naming is really cool feature! It's worth to do :).

We need to assume that:

  1. Some files can be without GPS data at all (cold start by record button) and renaming could lead to Unable to determine GPS date for GX010248.MP4 - GPS never locked without processing at all. Should be processed somehow anyway (example below);
  2. The only part from files that matters is ending (4 digits). It should be kept in any case;
  3. We do not want to produce extra entities (no folders plz). Just doing a complicated renaming;
  4. The location name can change from file to file, even within the same capture session;
  5. API-key parameter should be configurable.

The following example of renaming is my the best idea:

GX010186.MP4 to GX-0186-01_20220609-142311_region-city-state.MP4
GX010187.MP4 to GX-0187-01_20220609-142704_region-city-state.MP4
GX010188.MP4 to GX-0188-01_20220609-144251_region-city-state.MP4
GX010189.MP4 to GX-0189-01_20220609-144942_re-gi-on2-city-state.MP4
GX020187.MP4 to GX-0187-02_20220609-143224_region-city-state.MP4
GX020188.MP4 to GX-0188-02-20220609-144812_region-city-state.MP4
GX020189.MP4 to GX-0189-02_20220609-145502_re-gi-on2-city-state.MP4
GX010248.MP4 to GX-0248-01_no-gps.MP4
GX020248.MP4 to GX-0248-02_20220801-140000_region-city-state.MP4
GX010249.MP4 to GX-0249-01_20220909-151118.MP4 (site geodata or an internet connection is missing)

GoPro Camera File Naming Convention

released in 0.95.0 - note that I don't have an API key, so I can't really confirm that it works.