samuelbradshaw / python-scripture-scraper

Tool for downloading public domain scripture content from ChurchofJesusChrist.org.
MIT License
3 stars 2 forks source link

Unable to get current languages. #2

Closed KylerOlsen closed 2 months ago

KylerOlsen commented 2 months ago

The current languages can no longer be scraped from https://www.churchofjesuschrist.org/languages?lang=eng.

Getting languages
Found 0 languages

Creating metadata-languages.json
Creating metadata-scriptures.json
Creating metadata-uri-to-name.json

Traceback (most recent call last):
  File "d:\...\python-scripture-scraper\scrape.py", line 1265, in <module>
    main()
  File "d:\...\python-scripture-scraper\scrape.py", line 132, in main
    output_full_content(config.DEFAULT_LANG)
  File "d:\...\python-scripture-scraper\scrape.py", line 727, in output_full_content
    if metadata_scriptures['languages'][bcp47_lang]['churchAvailability'][publication_slug]:
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
KeyError: 'en'
KylerOlsen commented 2 months ago

The best work around I found so far is it use an older version of the page using the Wayback Machine.

samuelbradshaw commented 2 months ago

Thanks for your report! Glad you found a workaround. I'll see if I can find a longer-term fix later after work today.

samuelbradshaw commented 2 months ago

Fixed in this commit: https://github.com/samuelbradshaw/python-scripture-scraper/commit/ea2fb14f8522adf4f15e044c125ce4698b77915f