Guest User

Untitled

a guest
Jul 17th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. # InternalFieldSeperator_Backup
  2. IFS_BAK=$IFS
  3.  
  4. # splitting with newline
  5. IFS="
  6. "
  7.  
  8. for line in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS; do
  9. # download subtitle for selected line
  10. subliminal download -l en $line
  11. basefile="${line%.*}"
  12.  
  13. # renaming because vlc player loads subtitle automatically, if it find file_name.mp4 and file_name.srt in same folder
  14. mv $basefile".en.srt" $basefile".srt"
  15.  
  16. # notify-send for sending desktop notification popup
  17. notify-send "Subtitle for $line downloaded"
  18. done
  19.  
  20. # resetting IFS to its original value
  21. IFS=$IFS_BAK
Add Comment
Please, Sign In to add comment