wpoa / open-access-media-importer

A tool for harvesting media files from Open Access articles for upload into Wikimedia Commons
http://commons.wikimedia.org/wiki/User:Open_Access_Media_Importer_Bot
23 stars 8 forks source link

IndexError: string index out of range #136

Closed Daniel-Mietchen closed 9 years ago

Daniel-Mietchen commented 9 years ago

For 10.3389/fmicb.2014.00367, oami_pmc_doi_import ends with

Traceback (most recent call last):
  File "./oa-put", line 118, in <module>
    material_url)
  File "/home/danielmietchen/open-access-media-importer/helpers/template.py", line 95, in page
    category = _postprocess_category(category)
  File "/home/danielmietchen/open-access-media-importer/helpers/template.py", line 92, in _postprocess_category
    return category[0].capitalize() + category[1:]
IndexError: string index out of range
erlehmann commented 9 years ago

Attempting reproducing.

erlehmann commented 9 years ago

Running code from wmde-review branch shows that this one does not even convert on my computer. Without knowing which plugin is missing, I cannot reproduce this error.

; echo 10.3389/fmicb.2014.00367 | ./oami_pmc_doi_import -vvv
Input DOIs, delimited by whitespace: Getting PubMed Central IDs for given DOIs … found: 4110969
INFO: Downloading “http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=pmc&id=4110969”, saving into directory “/home/erlehmann/.cache/open-access-media-importer/metadata/raw/pmc_doi” …
/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py:573: SAWarning: Unicode type received non-unicodebind param value.
  param.append(processors[key](compiled_params[key]))
“Inter-species interconnections in acid mine drainage microbial communities”:
    9 × /
INFO: Checking MIME types …
INFO: DOI 10.3389/fmicb.2014.00367, http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4110969/bin/Movie1.MPG, source claimed / but is video/mpeg.
/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py:573: SAWarning: Unicode type received non-unicodebind param value.
  param.append(processors[key](compiled_params[key]))
INFO: DOI 10.3389/fmicb.2014.00367, http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4110969/bin/Movie2.MPG, source claimed / but is video/mpeg.
INFO: DOI 10.3389/fmicb.2014.00367, http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4110969/bin/Movie3.MPG, source claimed / but is video/mpeg.
INFO: DOI 10.3389/fmicb.2014.00367, http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4110969/bin/Movie4.MPG, source claimed / but is video/mpeg.
INFO: DOI 10.3389/fmicb.2014.00367, http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4110969/bin/Movie5.MPG, source claimed / but is video/mpeg.
INFO: DOI 10.3389/fmicb.2014.00367, http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4110969/bin/Movie6.MPG, source claimed / but is video/mpeg.
INFO: DOI 10.3389/fmicb.2014.00367, http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4110969/bin/Movie7.MPG, source claimed / but is video/mpeg.
INFO: DOI 10.3389/fmicb.2014.00367, http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4110969/bin/Movie8.MPG, source claimed / but is video/mpeg.
INFO: DOI 10.3389/fmicb.2014.00367, http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4110969/bin/DataSheet1.DOCX, source claimed / but is application/vnd.openxmlformats-officedocument.wordprocessingml.document.
DEBUG: Media path: /home/erlehmann/.cache/open-access-media-importer/media/raw/pmc_doi
DEBUG: Material http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4110969/bin/Movie1.MPG  video   10.3389/fmicb.2014.00367.
INFO: Skipping download of .
DEBUG: Material http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4110969/bin/Movie2.MPG  video   10.3389/fmicb.2014.00367.
INFO: Skipping download of .
DEBUG: Material http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4110969/bin/Movie3.MPG  video   10.3389/fmicb.2014.00367.
INFO: Skipping download of .
DEBUG: Material http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4110969/bin/Movie4.MPG  video   10.3389/fmicb.2014.00367.
INFO: Skipping download of .
DEBUG: Material http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4110969/bin/Movie5.MPG  video   10.3389/fmicb.2014.00367.
INFO: Skipping download of .
DEBUG: Material http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4110969/bin/Movie6.MPG  video   10.3389/fmicb.2014.00367.
INFO: Skipping download of .
DEBUG: Material http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4110969/bin/Movie7.MPG  video   10.3389/fmicb.2014.00367.
INFO: Skipping download of .
DEBUG: Material http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4110969/bin/Movie8.MPG  video   10.3389/fmicb.2014.00367.
INFO: Skipping download of .
DEBUG: Material http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4110969/bin/DataSheet1.DOCX application 10.3389/fmicb.2014.00367.
INFO: 8 materials found.
DEBUG: Converting http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4110969/bin/Movie1.MPG    video   10.3389/fmicb.2014.00367.
INFO: Converting “/home/erlehmann/.cache/open-access-media-importer/media/raw/pmc_doi/http%3A%2F%2Fwww.ncbi.nlm.nih.gov%2Fpmc%2Farticles%2FPMC4110969%2Fbin%2FMovie1.MPG”, saving into “/home/erlehmann/.cache/open-access-media-importer/media/refined/pmc_doi/http%3A%2F%2Fwww.ncbi.nlm.nih.gov%2Fpmc%2Farticles%2FPMC4110969%2Fbin%2FMovie1.MPG.ogg” … 
ERROR: Ihrer Installation von GStreamer fehlt ein Plugin.
ERROR: Unknown audio/video stream combination.: Skipping conversion of “/home/erlehmann/.cache/open-access-media-importer/media/raw/pmc_doi/http%3A%2F%2Fwww.ncbi.nlm.nih.gov%2Fpmc%2Farticles%2FPMC4110969%2Fbin%2FMovie1.MPG”.
DEBUG: Converting http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4110969/bin/Movie2.MPG    video   10.3389/fmicb.2014.00367.
INFO: Converting “/home/erlehmann/.cache/open-access-media-importer/media/raw/pmc_doi/http%3A%2F%2Fwww.ncbi.nlm.nih.gov%2Fpmc%2Farticles%2FPMC4110969%2Fbin%2FMovie2.MPG”, saving into “/home/erlehmann/.cache/open-access-media-importer/media/refined/pmc_doi/http%3A%2F%2Fwww.ncbi.nlm.nih.gov%2Fpmc%2Farticles%2FPMC4110969%2Fbin%2FMovie2.MPG.ogg” … 
ERROR: Ihrer Installation von GStreamer fehlt ein Plugin.
ERROR: Ihrer Installation von GStreamer fehlt ein Plugin.
DEBUG: Converting http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4110969/bin/Movie3.MPG    video   10.3389/fmicb.2014.00367.
INFO: Converting “/home/erlehmann/.cache/open-access-media-importer/media/raw/pmc_doi/http%3A%2F%2Fwww.ncbi.nlm.nih.gov%2Fpmc%2Farticles%2FPMC4110969%2Fbin%2FMovie3.MPG”, saving into “/home/erlehmann/.cache/open-access-media-importer/media/refined/pmc_doi/http%3A%2F%2Fwww.ncbi.nlm.nih.gov%2Fpmc%2Farticles%2FPMC4110969%2Fbin%2FMovie3.MPG.ogg” … 
ERROR: Ihrer Installation von GStreamer fehlt ein Plugin.
ERROR: Unknown audio/video stream combination.: Skipping conversion of “/home/erlehmann/.cache/open-access-media-importer/media/raw/pmc_doi/http%3A%2F%2Fwww.ncbi.nlm.nih.gov%2Fpmc%2Farticles%2FPMC4110969%2Fbin%2FMovie3.MPG”.
DEBUG: Converting http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4110969/bin/Movie4.MPG    video   10.3389/fmicb.2014.00367.
INFO: Converting “/home/erlehmann/.cache/open-access-media-importer/media/raw/pmc_doi/http%3A%2F%2Fwww.ncbi.nlm.nih.gov%2Fpmc%2Farticles%2FPMC4110969%2Fbin%2FMovie4.MPG”, saving into “/home/erlehmann/.cache/open-access-media-importer/media/refined/pmc_doi/http%3A%2F%2Fwww.ncbi.nlm.nih.gov%2Fpmc%2Farticles%2FPMC4110969%2Fbin%2FMovie4.MPG.ogg” … 
ERROR: Ihrer Installation von GStreamer fehlt ein Plugin.
ERROR: Ihrer Installation von GStreamer fehlt ein Plugin.
DEBUG: Converting http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4110969/bin/Movie5.MPG    video   10.3389/fmicb.2014.00367.
INFO: Converting “/home/erlehmann/.cache/open-access-media-importer/media/raw/pmc_doi/http%3A%2F%2Fwww.ncbi.nlm.nih.gov%2Fpmc%2Farticles%2FPMC4110969%2Fbin%2FMovie5.MPG”, saving into “/home/erlehmann/.cache/open-access-media-importer/media/refined/pmc_doi/http%3A%2F%2Fwww.ncbi.nlm.nih.gov%2Fpmc%2Farticles%2FPMC4110969%2Fbin%2FMovie5.MPG.ogg” … 
ERROR: Ihrer Installation von GStreamer fehlt ein Plugin.
ERROR: Ihrer Installation von GStreamer fehlt ein Plugin.
DEBUG: Converting http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4110969/bin/Movie6.MPG    video   10.3389/fmicb.2014.00367.
INFO: Converting “/home/erlehmann/.cache/open-access-media-importer/media/raw/pmc_doi/http%3A%2F%2Fwww.ncbi.nlm.nih.gov%2Fpmc%2Farticles%2FPMC4110969%2Fbin%2FMovie6.MPG”, saving into “/home/erlehmann/.cache/open-access-media-importer/media/refined/pmc_doi/http%3A%2F%2Fwww.ncbi.nlm.nih.gov%2Fpmc%2Farticles%2FPMC4110969%2Fbin%2FMovie6.MPG.ogg” … 
ERROR: Ihrer Installation von GStreamer fehlt ein Plugin.
ERROR: Ihrer Installation von GStreamer fehlt ein Plugin.
DEBUG: Converting http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4110969/bin/Movie7.MPG    video   10.3389/fmicb.2014.00367.
INFO: Converting “/home/erlehmann/.cache/open-access-media-importer/media/raw/pmc_doi/http%3A%2F%2Fwww.ncbi.nlm.nih.gov%2Fpmc%2Farticles%2FPMC4110969%2Fbin%2FMovie7.MPG”, saving into “/home/erlehmann/.cache/open-access-media-importer/media/refined/pmc_doi/http%3A%2F%2Fwww.ncbi.nlm.nih.gov%2Fpmc%2Farticles%2FPMC4110969%2Fbin%2FMovie7.MPG.ogg” … 
ERROR: Ihrer Installation von GStreamer fehlt ein Plugin.
ERROR: Ihrer Installation von GStreamer fehlt ein Plugin.
DEBUG: Converting http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4110969/bin/Movie8.MPG    video   10.3389/fmicb.2014.00367.
INFO: Converting “/home/erlehmann/.cache/open-access-media-importer/media/raw/pmc_doi/http%3A%2F%2Fwww.ncbi.nlm.nih.gov%2Fpmc%2Farticles%2FPMC4110969%2Fbin%2FMovie8.MPG”, saving into “/home/erlehmann/.cache/open-access-media-importer/media/refined/pmc_doi/http%3A%2F%2Fwww.ncbi.nlm.nih.gov%2Fpmc%2Farticles%2FPMC4110969%2Fbin%2FMovie8.MPG.ogg” … 
ERROR: Ihrer Installation von GStreamer fehlt ein Plugin.
ERROR: Ihrer Installation von GStreamer fehlt ein Plugin.
DEBUG: Uploading converted materials not uploaded.
DEBUG: Material http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4110969/bin/Movie2.MPG  video   10.3389/fmicb.2014.00367
WARNING: Empty file: /home/erlehmann/.cache/open-access-media-importer/media/refined/pmc_doi/http%3A%2F%2Fwww.ncbi.nlm.nih.gov%2Fpmc%2Farticles%2FPMC4110969%2Fbin%2FMovie2.MPG.ogg
erlehmann commented 9 years ago

Fixed in wmde-review branch.