arcusmaximus / YTSubConverter

A tool for creating styled YouTube subtitles
MIT License
767 stars 55 forks source link

Defer Application.Init call #57

Closed s0hv closed 2 years ago

s0hv commented 2 years ago

Currently the Linux version of the program does not work on machines without a display. Instead when trying to run it these messages will pop up.

Unable to init server: Could not connect: Connection refused

(YTSubConverter:12278): Gtk-WARNING **: 12:07:36.552: cannot open display:

This PR aims to fix this by moving the Application.Init call after the command line program check. After this change the above error messages don't appear and the program converts the subtitles successfully. This change should not affect how the GUI works on Linux but I am unable to test that.

arcusmaximus commented 2 years ago

I'm not entirely sure why (or how) you'd create subtitles on a displayless machine, but alright, merged :)

s0hv commented 2 years ago

I'm using it for archival purposes with yt-dlp so a display is not required 😄. This has been a huge help for converting subs to a more universal format in that regard.