Closed Avnsx closed 2 years ago
def startfile(filename):
try:
os.startfile(filename)
except:
subprocess.Popen(['xdg-open', filename])
if openwhenfinished: #could be a boolean doesn't matter really just sharing info
startfile(full_path)
works on arch linux
fixed in db5f987
I've recently noticed that https://github.com/Avnsx/fansly/blob/3f7aabaf8000cbf5636600159f64f6e4cb0d55c3/fansly_scraper.py#L189 is incompatible with any other OS then Windows, which means that the code will exit out on other operating systems erroring; once it has come to the end of the file instead of waiting 120 seconds before closing. This is a minor issue, since it is located at the end of the entire work process, but still something to pay attention to for v0.3.
Would be happy if anyone could come up with better solutions then
os.startfile
I personally think there's no way around doing an OS check, and then usingopen
(macOS),xdg-open
(Linux), oros.startfile()
for Windows