Unable to download proteins

PhyloPhlAn seems to be unable to find UniRef sequences (perhaps a change in the URL structure in UniProt?). This simple code reproduces the issue:

phylophlan_setup_database -g s__Xanthomonas_citri  --verbose 2>&1 | tee log/phylophlan_setup_database.log

And the messages are multiple failed downlooads:

...
Downloading "http://www.uniprot.org/uniref/UniRef90_A0A2H1SFM2.fasta" to "s__Xanthomonas_citri/A0A2H1SFM2.faa"
[e] unable to download "http://www.uniprot.org/uniref/UniRef90_A0A2H1SFM2.fasta"
Downloading "http://www.uniprot.org/uniref/UniRef90_H8FBN8.fasta" to "s__Xanthomonas_citri/H8FBN8.faa"
[e] unable to download "http://www.uniprot.org/uniref/UniRef90_H8FBN8.fasta"
Downloading "http://www.uniprot.org/uniref/UniRef90_A0A0W7Y4U0.fasta" to "s__Xanthomonas_citri/A0A0W7Y4U0.faa"
[e] unable to download "http://www.uniprot.org/uniref/UniRef90_A0A0W7Y4U0.fasta"
Downloading "http://www.uniprot.org/uniref/UniRef90_D4T8I5.fasta" to "s__Xanthomonas_citri/D4T8I5.faa"
[e] unable to download "http://www.uniprot.org/uniref/UniRef90_D4T8I5.fasta"
Downloading "http://www.uniprot.org/uniref/UniRef90_Q5H0C9.fasta" to "s__Xanthomonas_citri/Q5H0C9.faa"
[e] unable to download "http://www.uniprot.org/uniref/UniRef90_Q5H0C9.fasta"
Downloading "http://www.uniprot.org/uniref/UniRef90_A0A2S6YIG2.fasta" to "s__Xanthomonas_citri/A0A2S6YIG2.faa"
[e] unable to download "http://www.uniprot.org/uniref/UniRef90_A0A2S6YIG2.fasta"
Downloading "http://www.uniprot.org/uniref/UniRef90_A0A2H1S9C3.fasta" to "s__Xanthomonas_citri/A0A2H1S9C3.faa"
[e] unable to download "http://www.uniprot.org/uniref/UniRef90_A0A2H1S9C3.fasta"
Downloading "http://www.uniprot.org/uniref/UniRef90_Q3BMB6.fasta" to "s__Xanthomonas_citri/Q3BMB6.faa"
[e] unable to download "http://www.uniprot.org/uniref/UniRef90_Q3BMB6.fasta"
Downloading "http://www.uniprot.org/uniref/UniRef90_A0A0H2X5L3.fasta" to "s__Xanthomonas_citri/A0A0H2X5L3.faa"
[e] unable to download "http://www.uniprot.org/uniref/UniRef90_A0A0H2X5L3.fasta"
...

Strangely, most but not all downloads fail. I double-checked, and the URLs indeed point to a page with the error:

Error messages
Resource not found

Thanks!
Miguel.

BTW, the run finally fails with the message:

Re-trying to download 2457 core proteins that just failed, please wait as it might take some time
[e] unable convert UniProtKB ID to UniRef90 ID
Traceback (most recent call last):
  File "/home/c718/c7181116/.conda/envs/phylophlan/bin/phylophlan_setup_database", line 10, in <module>
    sys.exit(phylophlan_setup_database())
  File "/home/c718/c7181116/.conda/envs/phylophlan/lib/python3.10/site-packages/phylophlan/phylophlan_setup_database.py", line 407, in phylophlan_setup_database
    get_core_proteins(taxa2core_file_latest, args.get_core_proteins, args.output, args.output_extension, verbose=args.verbose)
  File "/home/c718/c7181116/.conda/envs/phylophlan/lib/python3.10/site-packages/phylophlan/phylophlan_setup_database.py", line 333, in get_core_proteins
    for uniref90_id in (x[1].split('_')[-1] for x in uniprotkb2uniref90[1:]):
UnboundLocalError: local variable 'uniprotkb2uniref90' referenced before assignment

Dear @lrr, thanks for reporting this. I believe this is the same issue as reported here UnboundLocalError: local variable 'uniprotkb2uniref90' referenced before assignment · Issue #98 · biobakery/phylophlan · GitHub.
Briefly, UniProt change the way to handle ID conversion, so I just finished implementing and testing the new APIs from UniProt that should solve this issue (updating UniRef90 IDs retrieval using latest APIs from UniProt · biobakery/phylophlan@c64a75f · GitHub).
Can you please pull the latest version form the PhyloPhlAn repo and check if the issue is solved?

Many thanks,
Francesco