question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pt-BR work with CLI but not with download_best_subtitles()

See original GitHub issue

Is there something I am missing?

CLI:

subliminal download -l pt-BR "12.Monkeys.S04E01.720p.HDTV.x264-KILLERS[rarbg].mkv"
Collecting videos  [####################################]  100%
1 video collected / 0 video ignored / 0 error

Python call to download_best_subtitles():

Traceback (most recent call last):
 File "get_subtitle.py", line 39, in download_subtitle
  best_subtitles = download_best_subtitles([video], {Language('pt-BR')}, providers=None)
 File "C:\\Python27\\lib\\site-packages\\babelfish\\language.py", line 82, in __init__
  raise ValueError(\%r is not a valid language\ % language)
ValueError: \pt-BR\ is not a valid language

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
ratoaq2commented, Feb 17, 2019

I don’t get why it’s surprising… cli accepts string and the best way to define a language is ietf code. Using it as a library, you can create a language object the way you want using the constructor that accepts multiple parameters, or any of the static methods. This is your choice, how to create the language object.

0reactions
morpheus65535commented, Feb 18, 2019

Definitely me misunderstanding but based on documentation, I was expecting both CLI and API to be using the same syntaxe for language code. Anyway, I had it working a long time ago using the mentioned fix. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

php curl works from cli but not from apache - Stack Overflow
When I look at my error logs, I get "PHP Fatal error: Call to undefined function curl_init()" as if the extension isn't installed...
Read more >
Can't Access 3650 Web Panel (but works on CLI)
I've had no issues accessing the panels via web on both switches, saved my passwords locally in Roboform too. Suddenly, my login is...
Read more >
"Open With" works in file explorer, but not through CLI
I have installed tuxguitar which can open .gp3 files when I double click on them, in the file explorer. This works perfectly fine....
Read more >
start-instances working from console but not from AWS CLI
We are trying to use the CLI to start and stop several EC2 instances. While testing commands on single instances we have noticed...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found