alexanderwink / subdl

subdl - command-line tool to download subtitles from opensubtitles.org Official support for subdl seems to have been dropped. This site is intended for the future use of subdl with community driven support.
87 stars 18 forks source link

Print name of file the search results are for #24

Closed Geoffrey-A closed 5 years ago

Geoffrey-A commented 5 years ago

Problem: when I do subdl -i *.mp4, I am not sure which file the printed results are for, which makes it difficult to choose the subtitles.

A solution is to show the file name before asking the user which subtitles to download, when in query mode:

diff --git a/subdl b/subdl
index 2f126a9..186c25a 100755
--- a/subdl
+++ b/subdl
@@ -481,6 +481,7 @@ def main(args):
             for search_result in search_results:
                 AutoDownloadAndSave(file, search_result, downloaded)
         elif options.download == 'query':
+            print("Search results for:", file)
             n = query_num("Enter result to download:",
                           1, len(search_results))
             AutoDownloadAndSave(file, search_results[n-1])

The solution I chose in this PR is to print the file name before listing the results, independently of the mode.

The second commit increases the version number in order to enable Linux distros to update their package for subdl if this change is merged.