don't use distutils to check if vlc is available

This commit is contained in:
Jimmy Kiselak 2015-08-27 23:32:45 -04:00
parent c8b2b7b279
commit 7eeac060ab

View file

@ -10,7 +10,7 @@ from lbrynet.interfaces import IStreamDownloaderFactory
from lbrynet.lbryfile.client.LBRYFileMetadataHandler import LBRYFileMetadataHandler from lbrynet.lbryfile.client.LBRYFileMetadataHandler import LBRYFileMetadataHandler
import os import os
from twisted.internet import defer, threads, reactor from twisted.internet import defer, threads, reactor
from distutils.spawn import find_executable from twisted.python.procutils import which
class LBRYFileDownloader(CryptStreamDownloader): class LBRYFileDownloader(CryptStreamDownloader):
@ -262,7 +262,7 @@ class LBRYFileOpener(LBRYFileDownloader):
class LBRYFileOpenerFactory(LBRYFileDownloaderFactory): class LBRYFileOpenerFactory(LBRYFileDownloaderFactory):
def can_download(self, sd_validator): def can_download(self, sd_validator):
return bool(find_executable('vlc')) return bool(which('vlc'))
def _make_downloader(self, stream_hash, payment_rate_manager, stream_info, upload_allowed): def _make_downloader(self, stream_hash, payment_rate_manager, stream_info, upload_allowed):
return LBRYFileOpener(stream_hash, self.peer_finder, self.rate_limiter, self.blob_manager, return LBRYFileOpener(stream_hash, self.peer_finder, self.rate_limiter, self.blob_manager,