View Single Post
Posts: 78 | Thanked: 57 times | Joined on Jul 2007
#372
I had a go at fixing this after reading through the earlier threads, but I do not know Python.

If you put this in after line 379 and comment out line 380 it works better, but not perfectly. The play button now works and the % completed shows when you are downloading, but the play button downloads the whole video before it will start playing.

Too tired now. Any hints would be welcome.

Code:
		#CHANGED BY ENGMEX/johnpad
		percent_str = percent_str.rstrip('%')
		percent_str = float(percent_str)
                if data_len_str.rfind('M') > -1:
			data_len_str = data_len_str.rstrip('M')
                        data_len_str = 1024*float(data_len_str)
		else:
			data_len_str = data_len_str.rstrip('k')
			data_len_str = float(data_len_str)
		counter = float(((data_len_str)/100)*percent_str)
                data_len_str = data_len_str/1024
		if counter < 1024:
			self.to_screen(u'\nRetrieving video data: %5s%% (%8.2fk of %8.2fM) at %8s/s ETA %s ' %
			(percent_str, counter, data_len_str, speed_str, eta_str), skip_eol=True)
		else:
			counter = counter/1024
			self.to_screen(u'\nRetrieving video data: %5s%% (%8.2fM of %sM) at %8s/s ETA %s ' %
			(percent_str, counter, data_len_str, speed_str, eta_str), skip_eol=True)
		#END ENGMEX/johnpad
		#self.to_screen(u'\r[download] %s of %s at %s ETA %s' % (percent_str, data_len_str, speed_str, eta_str), skip_eol=True)
Not quite in bed yet. Just realised the old script does not use a temporary .part file then rename it. So if we just comment out those bits it might just work.

-John

Last edited by johnpad; 2011-01-07 at 13:18.
 

The Following User Says Thank You to johnpad For This Useful Post: