spotdlgui/main.py
def download_song(self):
        '''
        This function downloads the list of the song specified and shows progress of download in string.
        '''

        self.output_path = app_utils.get_download_path()

        # Get search query from the text entry
        # ! Replaced from App.get_running_app().ids['searcher'].text because we're now using screens.
        search_query = self.ids['searcher'].text

        self.popup.change_text('Searching song(s)...')

        # Parse songs
        self.song_list = parse_query(
            [search_query],
            'mp3',
            False,
            False,
            1
        )

        # Save app path

        app_path = os.path.dirname(os.path.realpath(__file__))

        # Move to the output path

        os.chdir(self.output_path)

        for song in self.song_list:
            # Change popup text

            self.popup.change_text(
                f'Attempting to download \n"{song.song_name}" by {song.contributing_artists[0]}...')

            with DownloadManager() as downloader:                
              downloader.download_single_song(song)
                    
            self.popup.change_text(
                f'Succesfully downloaded \n"{song.song_name}" to ' + self.output_path)
            time.sleep(3)

        # Clean text on entry

        self.ids['searcher'].text = ''

        # Move to the app path

        os.chdir(app_path)

        # Close popup
        self.popup.dismiss()

        This function downloads the list of the song specified and shows progress of download in string.
        
This function downloads the list of the song specified and shows progress of download in string.
This function downloads the list of the song specified and shows progress of download in string .
def download_song(self):
        self.output_path = app_utils.get_download_path()
        search_query = self.ids['searcher'].text
        self.popup.change_text('Searching song(s)...')
        self.song_list = parse_query(
            [search_query],
            'mp3',
            False,
            False,
            1
        )
        app_path = os.path.dirname(os.path.realpath(__file__))
        os.chdir(self.output_path)
        for song in self.song_list:
            self.popup.change_text(
                f'Attempting to download \n"{song.song_name}" by {song.contributing_artists[0]}...')
            with DownloadManager() as downloader:                
              downloader.download_single_song(song)
            self.popup.change_text(
                f'Succesfully downloaded \n"{song.song_name}" to ' + self.output_path)
            time.sleep(3)
        self.ids['searcher'].text = ''
        os.chdir(app_path)
        self.popup.dismiss()
def download_song ( self ) : self . output_path = app_utils . get_download_path ( ) search_query = self . ids [ 'searcher' ] . text self . popup . change_text ( 'Searching song(s)...' ) self . song_list = parse_query ( [ search_query ] , 'mp3' , False , False , 1 ) app_path = os . path . dirname ( os . path . realpath ( __file__ ) ) os . chdir ( self . output_path ) for song in self . song_list : self . popup . change_text ( f'Attempting to download \n"{song.song_name}" by {song.contributing_artists[0]}...' ) with DownloadManager ( ) as downloader : downloader . download_single_song ( song ) self . popup . change_text ( f'Succesfully downloaded \n"{song.song_name}" to ' + self . output_path ) time . sleep ( 3 ) self . ids [ 'searcher' ] . text = '' os . chdir ( app_path ) self . popup . dismiss ( )
This function downloads the list of the song specified and shows progress of download in string.
This function downloads the list of the song specified and shows progress of download in string .
'''
        This function downloads the list of the song specified and shows progress of download in string.
        ''' # Get search query from the text entry # ! Replaced from App.get_running_app().ids['searcher'].text because we're now using screens. # Parse songs # Save app path # Move to the output path # Change popup text # Clean text on entry # Move to the app path # Close popup
self