Linekio / getmyancestors

Get GEDCOM files from FamilySearch.org
Other
161 stars 38 forks source link

Error while downloading a confidential profile with the -m and -r options #6

Closed aledeniz closed 5 years ago

aledeniz commented 5 years ago

As a FamilySearch user I want to download a gedcom using the -m and the -r options with the profile of a deceased person which has been marked as confidential.

To replicate, we may create the GGGG-000 and a GGGG-001 profile, both with a place of birth or a place of death in Turkey, and we add GGGG-001 as a spouse of GGGG-000. Eventually the profiles will be marked as confidential, and managed in a private space, as the ones of living people.

When trying to download a gedcom of one of those confidential deceased persons with getmyancestors.py called with the -m and the -r options, we get a similar error:

c:\Dev\GitHub\getmyancestors>python getmyancestors.py -u username -p password  -d 0 -a 0 -o "test.ged" -l "test.log"  -m -v -r -i GGGG-000

Login to FamilySearch...
Download starting individuals...
Download spouses and marriage information...
Download notes and contributors...
Traceback (most recent call last):
  File "getmyancestors.py", line 983, in <module>
    loop.run_until_complete(download_stuff(loop))
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\lib\asyncio\base_events.py", line 467, in run_until_complete
    return future.result()
  File "getmyancestors.py", line 979, in download_stuff
    await future
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64\lib\concurrent\futures\thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "getmyancestors.py", line 681, in get_contributors
    for entries in data['entries']:
TypeError: 'NoneType' object is not subscriptable

The gedcom is generated, but it is empty. This is the log file:

[2018-11-10 14:07:09]: Downloading: https://www.familysearch.org/auth/familysearch/login
[2018-11-10 14:07:09]: Downloading: https://ident.familysearch.org/cis-web/oauth2/v3/authorization?[..]
[2018-11-10 14:07:10]: Downloading: https://ident.familysearch.org/cis-web/oauth2/v3/authorization
[2018-11-10 14:07:10]: Downloading: https://www.familysearch.org/auth/familysearch/callback?[..]
[2018-11-10 14:07:11]: FamilySearch session id: [..]-aws-prod
[2018-11-10 14:07:11]: Downloading: /platform/users/current.json
[2018-11-10 14:07:11]: Status code: 200
[2018-11-10 14:07:11]: Downloading: /platform/tree/persons.json?pids=GGGG-000
[2018-11-10 14:07:12]: Status code: 200
[2018-11-10 14:07:12]: Downloading: /platform/tree/persons.json?pids=GGGG-001
[2018-11-10 14:07:13]: Status code: 200
[2018-11-10 14:07:13]: Downloading: /platform/tree/couple-relationships/MGGG-000.json
[2018-11-10 14:07:14]: Status code: 200
[2018-11-10 14:07:14]: Downloading: /platform/tree/persons/GGGG-000/notes.json
[2018-11-10 14:07:14]: Downloading: /platform/tree/persons/GGGG-000/changes.json
[2018-11-10 14:07:14]: Downloading: /platform/tree/persons/GGGG-001/notes.json
[2018-11-10 14:07:14]: Downloading: /platform/tree/persons/GGGG-001/changes.json
[2018-11-10 14:07:14]: Downloading: /platform/tree/couple-relationships/MGGG-000/notes.json
[2018-11-10 14:07:14]: Downloading: /platform/tree/couple-relationships/MGGG-000/changes.json
[2018-11-10 14:07:15]: Status code: 204
[2018-11-10 14:07:15]: Status code: 204
[2018-11-10 14:07:15]: Status code: 204
[2018-11-10 14:07:15]: Status code: 200
[2018-11-10 14:07:15]: Status code: 204
[2018-11-10 14:07:15]: Status code: 200

When executing the same line without the -m option, the gedcom gets generated successfully:

c:\Dev\GitHub\getmyancestors>python getmyancestors.py -u username -p password -d 0 -a 0 -o "test.ged" -l "test.log" -v -r -i GGGG-000
Login to FamilySearch...
Download starting individuals...
Download notes and contributors...
Downloaded 1 individuals, 0 families, 0 sources and 1 notes in 4 seconds with 4 HTTP requests.

This is the resulting gedcom:

0 HEAD
1 CHAR UTF-8
1 GEDC
2 VERS 5.5
2 FORM LINEAGE-LINKED
0 @I1@ INDI
1 NAME Mustafa /Turkum/
1 SEX M
1 DEAT
2 DATE 1 December 1954
1 BIRT
2 DATE 1897
2 PLAC Yalak, Sarız, Kayseri, Turkey
3 MAP
4 LATI 38.296781
4 LONG 36.434907
1 _FSFTID GGGG-000
1 NOTE @N1@
0 @N1@ NOTE === Contributors ===
1 CONT AlessandroRiolo
0 TRLR
Linekio commented 5 years ago

I suggest you to change your FS password since you forget to remove it from your message. However, could you log in to your familysearch account then give the result of https://www.familysearch.org/platform/tree/couple-relationships/MGGG-000/changes.json ?

aledeniz commented 5 years ago

GGGG-000, GGGG-001 and MGGG-000 are placeholders. As the actual profiles are confidential, I thought it was meaningless to provide them. I performed the query with one of those couple relationship between confidential profiles (MVKN-6KM), this is the outcome:

HTTP/1.1 204 No Content
Content-Type: application/json
Connection: keep-alive
Cache-Control: no-transform, must-revalidate, max-age=0
Date: Sat, 10 Nov 2018 18:17:14 GMT
Link: <https://www.familysearch.org/platform/tree/couple-relationships/MVKN-6KM.json?flag=fsh>; rel="relationship"
Link: <https://www.familysearch.org/platform/tree/couple-relationships/MVKN-6KM/changes.json?flag=fsh>; rel="self"
Server: Apache-Coyote/1.1
Vary: Accept, Accept-Language, Accept-Encoding, Expect
Vary: Accept-Encoding
Warning: 199 FamilySearch Best Practice Violation: Should specify versioned media type in Accept header, e.g. one of [ "application/x-gedcomx-v1+xml", "application/x-gedcomx-v1+json", "application/atom+xml", "application/x-gedcomx-atom+json", "application/x-fs-v1+xml", "application/x-fs-v1+json" ].
X-PROCESSING-TIME: 9
X-Cache: Miss from cloudfront
Via: 1.1 [..].cloudfront.net (CloudFront)
X-Amz-Cf-Id: [..]==
Linekio commented 5 years ago

Should be fixed with 3b87242d0ae02b588bd9fcba2e8cdffcbf0ad552

aledeniz commented 5 years ago

Just to confirm that the fix works. Thanks.