How to use the tartube.downloads.VideoDownloader function in tartube

To help you get started, we’ve selected a few tartube examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github axcore / tartube / tartube / downloads.py View on Github external
app_obj = self.download_manager_obj.app_obj

        # Handle a job, or wait for the downloads.DownloadManager to assign
        #   this worker a job
        while self.running_flag:

            # If this worker is currently assigned a job...
            if not self.available_flag:

                # youtube-dl-gui used a single instance of a
                #   YoutubeDLDownloader object for each instance of a Worker
                #   object.
                # This causes problems, so Tartube will use a new
                #   downloads.VideoDownloader object each time
                # Set up the new downloads.VideoDownloader object
                self.video_downloader_obj = VideoDownloader(
                    self.download_manager_obj,
                    self,
                    self.download_item_obj,
                )

                # Send a message to the Output Tab's summary page
                app_obj.main_win_obj.output_tab_write_stdout(
                    0,
                    'Thread #' + str(self.worker_id) \
                    + ': Assigned job \'' \
                    + self.download_item_obj.media_data_obj.name + '\'',
                )

                # Then execute the assigned job
                return_code = self.video_downloader_obj.do_download()