Jump to content

Zimmer

Dedicated Members
  • Posts

    670
  • Joined

  • Last visited

Everything posted by Zimmer

  1. Go with python (and I'd be happy to explain things, I know that these things were hard understaning: OOP, Twisted, GUI and event driven architectures, etc).
  2. One thing that would help with scams is well braking an already established rule, set up the item here etc but have all the buying go through ebay (or craigslist to a lesser extent) (Yes I know it says in the rules not to so I won't do this if it is against the rules but I am briging it up as I feel it would help a lot) that way it is through ebay which is better than nothing and then use paypal. Also with the mention of paypal, what are your opinions on paypal 's customer service etc (the sites like paypalsucks.com that list some times when paypal was no your pal).
  3. Die Hard 4 is a little far fetched (ok a lot) but the basic principle of real world damage being caused by a netbook is plausible. Now why are these on any network or even computer (ok computers to monitor it (but should be able to do anything else) and embed systems but a computer that is connected to the internet)!?!?!?!?!
  4. Well I was going through wikileaks (looking at the insurance file) and saw they had it on thepiratebay, so I clicked the link (figured there might be some more info) and was suddenly interrupted by a google page saying this page is dangerous. I figured, that it was either spam or something relatively innocuous, or maybe even google helping the mpaa (though hadn't noticed any news that would be that so kinda doubted it). So after this I said I wanted to continue thinking that it was most likely just marked because of the sleezy ads. Well turns out it is, a little digging and it looks to be a fake google page to get you to log in. Here is what I observed, first I observed a little slow loading on thepiratebay (Well it displayed but chrome was still fetching something) then VLC opened with some temp file (ok I figured what video exploit, though I didn't think it as much of a threat (sense it is a data exploit, so not nearly as easy). I then shutdown VLC and opened task manger, checking my process (I do that usually every week) and saw java.exe, huh sense I hadn't been running any java applets and it hadn't appear in any recent weeks, so I killed it and the went hunting for the temp file vlc had opened, I quickly founded it and examined it, it was some javascript and html, as well as a java log... I figure it was a bad phishing attempt. Below are the files, figured you might enjoy them (I found them interesting) or might see something I missed. CLICKED ON LINKS AT OWN RISK, IF YOU WANT TO SEE SOURCE EITHER USE SOMETHING LIKE WGET OR LIKE I DID AND USE W3C'S HTML CHECKER Java Log Temp file opened by vlc (contained 0 bytes) Other temp file Source of links http:// htolpy.com :8080/u24 / 4250efc33bf5918ccbea5078ed431af3.php and http:// htolpy.com:8080 /u24/ 99a7825abe01a60aa788736afbe248ce.php?showuser=24715108&view=Chrome&showforum=us3 <-- broken up so no accidental clicks to it Note they had what looked to be the same source Other html file that I found got deleted but was just a script tag that had javascript that sent you back in your history, had a parameter of -2, so I think it went back in your history twice
  5. There is a reason that people suffer from greed, lust, sloth, etc it is human nature, either through the environment or evolution. Also you could say everything is available to everyone today, for a price and if that price would exist, people's "wants" would be encouraged to a point of everyone trying to get what they want, after all there is no price anymore that counter acts the want. So a price is needed or some type of control, but then if comes down to the question of who, who should get to decide, or what group, or how. The current systems used by countries today are not perfect, no system is perfect when it comes to putting it into practice, the only time a system would work as well as it does in theory is in a Utopian society, but then it would be irrelevant.
  6. I also had to do that recently, it isn't that hard with gui2exe though makes it really easy.
  7. I also had to do that recently, it isn't that hard with gui2exe though makes it really easy.
  8. Is the NAS box using samba or what, also would you just want to specify a time and a source and then an option for destination (it could just mirror the structure on the backup)?
  9. Ya I have a 2Wire (AT&T, ugh) and it is decent sometimes craps out but redirects you to a nice interface that makes it easy to reboot (asks you for your password then ask if you are sure and that internet will be gone etc). It is decent though the wireless range isn't the best.
  10. Well damn Vako you summed up a lot of my thoughts to (well that and I think any philanthropy should be from the people not the government (because then it is hard to stop, and very corrupt (e.g what I think what will happen with government healthcare ) ).
  11. Money is nothing, its just the promise that is can be something. Money itself is just cotton (or some other material) that carries with it a promise that people will take that and give you something else. But if that promise is undermined (e.g in WWII Hitler was going to drop counterfeit pounds over Britain causing their money to be nothing after all you can just get it out of the sky and so the promise that this piece of paper has value is gone). Example (I can't find where I read this but I am paraphrasing) ''' One day a person was in Mexico on vacation and saw a fisherman came in and asked him how good the catch was, he said that it was good, the person then asked why the fisherman hadn't stayed out longer and got more fish and make more money. The fisherman replied that he had enough for his family and to sell why catch more, when he could instead play with his kids, drink with his friends and take a siesta the person replied so that you can make more money and expand (the actual story continues with how etc) until you are a ceo and have fishing trawlers and are rich and wealthy and the person continues you can then retire and the fisherman asked then what. the person said in reply, you can then play with your kids, drink with your friends and take a siesta ''' Also there is not enough resources for everyone to live fairly AND not be dirt poor, there just isn't and so there will always be a unfairness, but then again whoever promised you a fair life. Also Vako did your account get hacked your talking like a capitalist :P
  12. Agreed yet with all this technology we seem to have the same problems and same debates. With all this technology it still seems humans make the same mistakes. We still fight wars over religion. We still fight wars over money. We try the same things and expect different results We trust the government, private companies, lobbyist, unions, etc etc to help us and look out for are best interests and then realize they have their own agenda (just think of the last 4 presidents (the 2 Bushes, Clinton, and Obama) ) --------- will add more later, battery dying though.
  13. Well sense we are on the topic of money and inflation a depressing blog (and link) http://theeconomiccollapseblog.com/archive...s-national-debt
  14. I am playing Pokemon Red on my iPod, its a fun game.
  15. Dang I guess I don't have the slowest machine with a 600mhz Pentium III, 5G Hard Drive, and 128 mb RAM :(. < still ran win 2k and xubuntu good till the monitor went toast. I miss win 2k. It ran one server, i don't think it could handle virtual servers on top of that
  16. Oddly enough this started because of the US and USSR Cold War and has continued into other cold wars, though maybe not label so, they still are. Plus the US would still back Israeli because they are the only democracy in the area (though Egypt is a republic, still not the US's favorite government ;) ) they will just need another excuse.
  17. Update Replace Player.py with this one here http://www.mediafire.com/?5noe3miyomm It will add support for twisted 8.2
  18. So sorry, in the twisted_grooveshark_gui.py file add at the top import twisted
  19. It seems your using an older version of twisted Update. If you were having issue replace your Twisted_Grooveshark_GUI.py file with this (this WILL NOT work with Sharky.exe) Please note this may not FIX the issue, if so please re post the log. Thank You and sorry for the inconvenience #!/usr/bin/python #python imports import sys import os import urllib #Twisted Stuff import twisted from twisted.internet import wxreactor wxreactor.install() from twisted.internet import reactor from twisted.python import log #wx python libaries import wx from wx.lib.mixins.listctrl import CheckListCtrlMixin, ListCtrlAutoWidthMixin from SimpleDialog import SimpleDialog # app libaries from Settings import Settings from Player import Player, DownloadManager, URLObject from twisted_Grooveshark import Grooveshark, EmptyJSONList from twisted_update import update, CurrentVersion, NoUpdate LEGAL = '''\ This application could be considered illegal for a number of reasons, please contact a lawyer for further information. We (the authors) are not responsible for any legal (or any other) trouble that results from the use of this application. ''' VERSION = '2010.6.4.1' class StandardError(Exception): '''Standard Error for anything that doesn't fit for another error, or that error would be extremely specific.''' class SettingsError(Exception): ''' An Error for Settings''' class StartGroovesharkError(Exception): '''Error Starting Grooveshark''' #Begin WX CODE # Defined subclass for list types in popular and search tabs class CheckListCtrl(wx.ListCtrl, CheckListCtrlMixin, ListCtrlAutoWidthMixin): 'This class is for the check box list in both the popular and search tabs' def __init__(self, parent, size, pos): wx.ListCtrl.__init__(self, parent, -1, style=wx.LC_REPORT, size = size, pos = pos) CheckListCtrlMixin.__init__(self) ListCtrlAutoWidthMixin.__init__(self) # About Me Panel class AboutMe(wx.Panel): def __init__(self, parent, size, pos): log.msg('Setting up about page') log.msg('__init__ of wx.Panel') wx.Panel.__init__(self, parent, -1, size = size, pos = pos) # Grooveshark Image log.msg('Creating image') image = wx.Image('grooveshark_about.png', wx.BITMAP_TYPE_ANY) height = image.GetHeight() width = image.GetWidth() image = image.Scale(height/7.0, width/7.0) height = image.GetHeight() width = image.GetWidth() log.msg('wx.StaticBitmap - Grooveshark Icon') wx.StaticBitmap(self, -1, image.ConvertToBitmap(), pos = (250 - (width/2.0),100 - (height/2.0))) wx.StaticText(self, -1, ' Author: Zimmer', pos = (200, 175)) wx.StaticText(self, -1, ' App Name: Sharky', pos = (200, 190)) #Searh Panel class Search(wx.Panel): def __init__(self, parent, size, pos): log.msg('Accessing Grooveshark and Settings') self.settings = parent.s self.g = parent.g log.msg('__init__ of wx.Panel') wx.Panel.__init__(self, parent, -1, size = size, pos = pos) #Search Bar log.msg('Setting up Search Bar and Search Button') self.search_bar = wx.TextCtrl(self, -1, size = (400, 20), pos = (20,10), style = wx.TE_PROCESS_ENTER) self.search_bar.SetValue('Search') #Search Button self.search_button = wx.Button(self, -1, size = (60,20), pos = (425, 10), label = 'Search') #Search Result Listings log.msg('Creating CheckListCtrl') self.search_results = CheckListCtrl(self, size =(465,160), pos = (20,50)) self.search_results.InsertColumn(0, ' ', width = 20) self.search_results.InsertColumn(1, 'Song Name', width = 170) self.search_results.InsertColumn(2, 'Album Name', width = 170) self.search_results.InsertColumn(3, 'Artist', width = 100) #Play and Download Buttons log.msg('Creating Play and Download Button') self.play = wx.Button(self, -1, "Play Selected", size = (100,20), pos = (275, 215)) self.download = wx.Button(self, -1, "Download Selected", size = (100,20), pos = (385, 215)) #info text log.msg('Creating info text and search progress gauge') self.info_text = wx.StaticText(self, -1, 'Please Input a Search Above', pos = (20, 35)) #progress bar self.prog_bar = wx.Gauge(self, -1, 1, (220, 30), (100, 15)) self.prog_bar.Hide() self.timer = wx.Timer(self) # Bind Events log.msg('binding search tab events') self.Bind(wx.EVT_TIMER, self.on_timer) self.Bind(wx.EVT_TEXT_ENTER, self.on_search, self.search_bar) self.Bind(wx.EVT_BUTTON, self.on_search, self.search_button) self.Bind(wx.EVT_BUTTON, self.on_play, self.play) self.Bind(wx.EVT_BUTTON, self.on_download, self.download) self.Bind(wx.EVT_LIST_ITEM_FOCUSED, self.on_list_item_focus) def on_list_item_focus(self, event): print 'on_focus called' print event.GetLabel() print event.GetPoint() print event.GetIndex() def start_grooveshark(self): grooveshark_dialog = Start_Grooveshark(self.GetParent()) r = grooveshark_dialog.ShowModal() if r == wx.ID_CLOSE: # ask to retry r = self.grooveshark_retry() if r == wx.ID_YES: self.start_grooveshark() else: self.GetParent().ChangeSelection(0) else: self.settings.grooveshark_started = True def grooveshark_retry(self): log.msg('Asking User if they want to try and get all the Grooveshark Data again.') g_dlg = SimpleDialog(self, 'Could not start Grooveshark\nTry Again?\n\n Note: Grooveshark cannot be used if you click no \nuntil you click retry in the about tab.', 'Retry?', wx.YES_NO | wx.ICON_QUESTION) result = g_dlg.ShowModal() if result == wx.ID_YES: log.msg('User Clicked Yes') return wx.ID_YES elif result == wx.ID_NO: log.msg('User Clicked No') return wx.ID_NO else: log.msg('Listen We Have Problems, when asking the user whether or not to retry getting grooveshark data, the user neither pressed YES OR NO') # HELPER METHOD def start_progress_bar(self): self.timer.Start(50) self.prog_bar.Show() def stop_progress_bar(self): self.timer.Stop() self.prog_bar.Hide() def error(self, error): self.info_text.SetLabel('Error: %s' % error) def set_info_text(self, information): self.info_text.SetLabel(information) def search_error(self, error): self.error('Could not complete search. Check log for details.') self.stop_progress_bar() log.msg('******Search Error******') log.err(error) log.msg('=================') log.msg('\n') def play_error(self, error): self.set_info_text('There was an error during playback or while preparing for playback. Check log for details.') log.msg('******Playback Error******') log.err(error) log.msg('=================\n') def download_error(self, error): self.set_info_text('There was an error downloading.') log.msg('******Playback Error******') log.err(error) log.msg('=================\n') # /HELPER METHODS #Events def on_timer(self, event): self.prog_bar.Pulse() def on_search(self, event): #Start Progress Bar self.start_progress_bar() #Notify the user self.set_info_text('Searching...') # log.msg('Search String: %s' % self.search_bar.GetValue()) #Callbacks search = self.search_bar.GetValue().lower() d = self.g.search(search) d.addCallback(self.display_search) d.addErrback(self.search_error) def on_play(self, event): log.msg('User Clicked Play Button.') if self.settings.mplayer == 'download': dlg = SimpleDialog(None, 'Please download MPlayer and put it in either the application folder, or set where MPlayer in the Options Tab', 'MPlayer Error', style = wx.OK) result = dlg.ShowModal() print 'Result (AFTER) %s' % result else: log.msg('Getting Checked Songs') # get checked songs try: song_names, ids = self.get_checked_songs() except StandardError: log.err() dlg = SimpleDialog(None, 'Error: Unable to start playback due to an unknow error, please try again.\n\nSorry for the inconvience', 'Playback Error', style = wx.OK) dlg.ShowModal() else:#if there was success log.msg('Got checked songs: %s' % len(song_names)) d = self.g.get_song_urls(ids)# passes stream data d.addCallback(self.stream_handler, song_names) d.addErrback(self.play_error) def on_download(self, event): log.msg('User Clicked Download Button.') log.msg('Getting Checked Songs') #get checked songs try: song_names, ids = self.get_checked_songs() except StandardError: # Stops it so it doesn't error saying that None is unpackable, but we have already dealt with the error so we don't need to do anything here either. pass else:#if there was success log.msg('Got checked songs: %s' % len(song_names)) d = self.g.get_song_urls(ids)# passes stream data d.addCallback(self.download_handler, song_names) d.addErrback(self.download_error) def stream_handler(self, _data, song_names): # _data is a tuple of the urls and data, check we have atleast one url if len(_data[0]) &lt; 1: dlg = SimpleDialog(None, 'Error contacting grooveshark.com, can not continue.', 'Playback Error', style = wx.OK) dlg.ShowModal() else: print 'Preceding' print _data keys, urls = _data # Test whether if all of the values in urls are skips if all( ['SKIP' == url for url in urls] ): # if we need to skip them all then dlg = SimpleDialog(None, 'Invalid Search Entry. Grooveshark sometimes returns a song that no longer exists.', 'Playback Error', style = wx.OK) dlg.ShowModal() else: # files, urls files = [] for file_name in song_names: files.append(os.path.join(self.settings.music_folder, file_name + '.mp3')) p = Player(self) dm = DownloadManager() for url, file, data in zip(urls, files, keys): p.load_url(url = 'http://' + url + '/stream.php', filename = file, method = 'POST', postdata = 'streamKey=%s' % data.encode('ascii'), headers = {'content-type': 'application/x-www-form-urlencoded'}) for urlobject in p.playback_queue: dm.add_urlobject(urlobject) self.GetParent().GetParent().downloads.add_url(urlobject) dm.start_downloads() wx.CallLater(10000, p.Show) def download_handler(self, _data, song_names): # _data is a tuple of the urls and data, check we have atleast one url if len(_data[0]) &lt; 1: dlg = SimpleDialog(None, 'Error contacting grooveshark.com, can not continue.', 'Playback Error', style = wx.OK) dlg.ShowModal() else: keys, urls = _data if all( ['SKIP' == url for url in urls] ): # if we need to skip them all then dlg = SimpleDialog(None, 'Invalid Search Entry. Grooveshark sometimes returns a song that no longer exists.', 'Download Error', style = wx.OK) dlg.ShowModal() else: files = [] for file_name in song_names: files.append(os.path.join(self.settings.music_folder, file_name + '.mp3')) dm = DownloadManager() for url, file, data in zip(urls, files, keys): urlobject = URLObject('http://' + url + '/stream.php', file, 'POST', postdata = 'streamKey=%s' % data.encode('ascii'), headers = {'content-type': 'application/x-www-form-urlencoded'}) dm.add_urlobject(urlobject) self.GetParent().GetParent().downloads.add_url(urlobject) dm.start_downloads() # /events # /processing methods (used by event methods) def display_search(self, search_results): log.msg('Displaying Search Results') log.msg('Deleting any old results.') self.search_results.DeleteAllItems()#Deletes any items that where there prevouisly log.msg('Deleted old results.') self.song_ids = [] self.song_names = [] log.msg('Enumerating through results.') print type(search_results) print len(search_results) for n,i in enumerate(search_results): index = self.search_results.InsertStringItem(n+1, str(n+1)+'.') try: self.search_results.SetStringItem(index, 1, i['Name']) except UnicodeEncodeError: self.search_results.SetStringItem(index, 1, repr(i['Name'])[2:-1]) self.search_results.SetStringItem(index, 2, i['AlbumName']) try: self.search_results.SetStringItem(index, 3, i['ArtistName']) except TypeError: self.search_results.SetStringItem(index, 1, '') self.song_ids.append(i['SongID']) self.song_names.append(i['Name']) log.msg('Done Displaying Results.') self.timer.Stop() self.prog_bar.Hide() log.msg('Stopping Progress Bar.') self.set_info_text('Done.') log.msg('Done with search results.') def get_checked_songs(self): item_count = self.search_results.GetItemCount() checked_song_ids = [] checked_song_names = [] log.msg('Item Count (Number of Songs): %s' % item_count) for i in xrange(item_count): if self.search_results.IsChecked(i): checked_song_ids.append(self.song_ids[i]) checked_song_names.append(self.song_names[i]) #Check that the item amounts are equal if not len(checked_song_ids) == len(checked_song_names): #We got problems log.msg('******Error******') log.msg('The number of ids and the number of song names does not equal each other.') log.msg('Name(s): %s' % len(checked_songs_names)) log.msg('Id(s): %s' % len(checked_songs_ids)) log.msg('=================') log.msg('\n') self.error('An unknown error occured.') raise StandardError('An unknown error occured') if len(checked_song_ids) &lt; 1 and len(checked_song_names) &lt; 1: log.msg('******Error******') log.msg('No Songs checked selected.') log.msg('=================') log.msg('\n') self.error('No items checked.') raise StandardError('No items checked') else: return checked_song_names, checked_song_ids class Main(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent = parent, id = id, title = title, size = (500,300)) log.startLogging(sys.stdout) self.s = Settings() log.startLogging(open(self.s.log_file, 'wb')) log.msg('Started Logging') log.msg('Using Twisted Version: %s' % twisted.version) log.msg('Starting Grooveshark and Started Settings.') self.g = Grooveshark() # start up grooveshark #Create notebook log.msg('Setting up Notebook') self.notebook = wx.Notebook(self) self.notebook.g = self.g #Sets Settings to also notebook for parent referance self.notebook.s = self.s #Tabs log.msg('Adding Tabs (About)') log.msg('Creating Instances of AboutMe') self.about = AboutMe(self.notebook, (500,300), (0,0)) self.search = Search(self.notebook, (500,300), (0,0)) self.options = OptionsPanel(self.notebook, (500,300), (0,0)) self.downloads = DownloadListCtrl(self.notebook, (500,300), (0, 0)) log.msg('Adding it as tab to Notebook') self.notebook.AddPage(self.about, 'About') self.notebook.AddPage(self.search, 'Search') self.notebook.AddPage(self.options, 'Options') self.notebook.AddPage(self.downloads, 'Downloads') #App Cleanup self.Bind(wx.EVT_CLOSE, self.stop_reactor) self.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGED, self.tab_change) #Show Dialog #self.run_twisted() log.msg('Starting Twisted') # if reactor.running: # log.msg('Twisted is running.') # self.s.twisted_running = True # else: # log.msg('Twisted is not running') # self.s.twisted_running = False # dlg = SimpleDialog(None, 'Error: Network backend not running. This is not your fault, please try restarting this application and try again. \nSorry For the Inconvience.', 'Error', wx.OK | wx.ICON_ERROR) # dlg.ShowModal() if not self.s.eula: dlg = SimpleDialog(None, LEGAL, 'Legal: Eula Agreement.', style = wx.YES_NO) if dlg.ShowModal() == wx.ID_YES: log.msg('User agreed to the eula.') self.s.eula = True else: log.msg('User did not agree to the eula.') self.Destroy() # only do this if the eula has been agreed to if self.s.eula: # check for updates d = update(VERSION) d.addCallback(self.new_version) d.addErrback(self.current_version) def new_version(self, version): # Got a new version log.msg('Found New New Version: %s' % str(version)) dlg = SimpleDialog(None, 'New Version!\nVersion: %s' % version, 'New Version', style = wx.OK) dlg.ShowModal() def current_version(self, error): try: error.raiseException() except CurrentVersion: log.msg('Got Current Version') except NoUpdate: log.msg('Got Newer Version Huh') except: log.msg('Uknown Error; Unable to update') log.err() def tab_change(self, event): log.msg('Tab Changed') log.msg('Tab Changed to: %s' % self.notebook.GetCurrentPage()) # start Grooveshark if type(self.notebook.GetCurrentPage()) == Search:# if the class is an instance of Search log.msg('Switched to Search Tab') if self.s.grooveshark_started: log.msg('Grooveshark is started') else: log.msg('Grooveshark is not started. Starting.') self.notebook.GetCurrentPage().start_grooveshark() def stop_reactor(self, event): log.msg('Stopping Reactor') #Stop Reactor reactor.stop() log.msg('Destroying Window') #Destroy Windows self.Destroy() log.msg('Quiting') log.msg('\n\n')#Add Two lines so it is easy to distinguish between two app instances #Quit sys.exit() #Twisted Support def run_twisted(self): reactor.startRunning(installSignalHandlers=0) timerid = wx.NewId() self.timer = wx.Timer(self, timerid) wx.EVT_TIMER(self, timerid, self.OnTimer) self.timer.Start(10, False) def OnTimer(self, event): reactor.runUntilCurrent() reactor.doIteration(0) #End Twisted Support class Start_Grooveshark(wx.Dialog):#Starts Grooveshark and gets the basics like the session, uuid, and token def __init__(self, parent): print type(parent) wx.Dialog.__init__(self, parent = parent, id = -1, title = 'Starting Grooveshark', style = wx.SYSTEM_MENU) self.s = parent.s self.info_text = wx.StaticText(self, -1, 'Getting Groooveshark Data.', pos = (5,10)) self.info_text.Wrap(385) if not reactor.running: log.msg('\n\n ERROR ERROR ERROR \n TWISTED IS !NOT! RUNNING \ ERROR ERROR ERROR \n\n ') dial = SimpleDialog(None, 'Error: Network backend not running. This is not your fault, please try restarting this application and try again. \nSorry For the Inconvience.', 'Error', wx.OK | wx.ICON_ERROR) dial.ShowModal() else: self.g = parent.g d=self.session() d.addCallback(self.session_complete) d.addErrback(self.error) def session(self): log.msg('Getting Grooveshark Session.') d = self.g.session_and_country() return d def update_info(self, text): log.msg('Updating Grooveshark Info: %s' % repr(text)) self.info_text.SetLabel(text) self.info_text.Wrap(385) def error(self, error): log.msg('******Error******') log.err(error) log.msg('****End Error****') self.update_info('Error: %s' % error.getErrorMessage()) self.SetReturnCode(wx.ID_CLOSE) self.count = 5 wx.CallLater(1000, self.countdown) def countdown(self): original_text = self.info_text.GetLabel().replace('\n\n\tClosing in (%s)' % (self.count + 1), '') self.update_info(original_text + '\n\n\tClosing in (%s)' % self.count) self.count = self.count -1 if self.count &gt;= 0: wx.CallLater(1000, self.countdown) else: self.Destroy() def session_complete(self, vars): log.msg('Session: %s' % vars['sessionID']) log.msg('Country ID: %s' % urllib.unquote(vars['country'])) # get token d = self.g.get_token() d.addCallback(self.token_complete) d.addErrback(self.error) def token_complete(self, token): log.msg('token_complete') self.update_info('Got Token. Done.') wx.CallLater(100, self.Destroy) def grooveshark_retry(self): log.msg('Asking User if they want to try and get all the Grooveshark Data again.') g_dlg = SimpleDialog(self, 'Could not start Grooveshark\nTry Again?\n\n Note: Grooveshark cannot be used if you click no \nuntil you click retry in the about tab.', 'Retry?', wx.YES_NO | wx.ICON_QUESTION) result = g_dlg.ShowModal() if result == wx.ID_YES: log.msg('User Clicked Yes') return wx.ID_YES else: log.msg('User Clicked No') return wx.ID_NO class DownloadListCtrl(wx.Panel): def __init__(self, parent, size, pos): wx.Panel.__init__(self, parent, -1, size = size, pos = pos) print 'ListCtrl Size: %s' % str(size) self.list=wx.ListCtrl(self, -1, style=wx.LC_REPORT|wx.SUNKEN_BORDER, pos = (0, 0), size = (size[0] - 18, size[1] - 63)) self.list.Show(True) self.list.InsertColumn(0, "URL") self.list.InsertColumn(1, "Path") self.list.InsertColumn(2, "Percent Downloaded") self.list.InsertColumn(3, "State") self.downloads = [] def add_url(self, urlobject): download_item = DownloadItem(urlobject) # insert don't append so we can use the index as the index for the list ctrl also self.downloads.append(download_item) print 'GETITEMCOUNT %s' % self.list.GetItemCount() position = self.list.InsertStringItem(self.list.GetItemCount(), urlobject.url) self.list.SetStringItem(position, 1, urlobject.path) self.list.SetStringItem(position, 2, '0%') if urlobject.started: self.list.SetStringItem(position, 3, 'Downloading') else: self.list.SetStringItem(position, 3, 'Waiting') download_item.add_size_callback(self.update_percent) def update_state(self, state, download_item): position = self.downloads.index(download_item) self.list.SetStringItem(position, 3, state) def update_percent(self, percent, download_item): position = self.downloads.index(download_item) self.list.SetStringItem(position, 2, '%.1f%%' % percent ) if percent == 100: self.list.SetStringItem(position, 3, 'Done') class DownloadItem(object): def __init__(self, urlobject): self.urlobject = urlobject self.url = urlobject.url self.path = urlobject.path self.started = urlobject.started self.size_callbacks = [] self.percent = None urlobject.add_size_callback(self.data_received) def data_received(self, data_length): print 'Received Data' for callback in self.size_callbacks: if self.urlobject.total_amount is not None and not self.urlobject.total_amount == 0: self.percent = (float(data_length) / float(self.urlobject.total_amount)) * 100 callback(self.percent, self) def add_size_callback(self, callback): assert callable(callback) # update the callback if self.percent is not None: callback(self.percent) self.size_callbacks.append(callback) class OptionsPanel(wx.Panel): def __init__(self, parent, size, pos): wx.Panel.__init__(self, parent, -1, size = size, pos = pos) self.s = self.GetParent().s #Save Path self.change_path_text = wx.StaticText(self, -1, 'Change Save Path:', pos = (20,3)) self.display_path = wx.TextCtrl(self, -1, self.s.music_folder, pos = (110,21), size = (300, -1)) self.save_button = wx.Button(self, -1, 'Change', pos = (20,20)) #Mplayer self.change_mplayer_text = wx.StaticText(self, -1, 'Change MPlayer Path:', pos = (20,45)) self.display_mplayer_path = wx.TextCtrl(self, -1, self.s.mplayer, pos = (110,66), size = (300, -1)) self.mplayer_button = wx.Button(self, -1, 'Change', pos = (20,65)) # Download Percent self.download_percent_text = wx.StaticText(self, -1, 'Change Playback Buffer (%):', pos = (20, 90)) self.download_percent_display = wx.TextCtrl(self, -1, '%s' % int( self.s.download_percent * 100 ), pos = (150, 110), size = (25, -1)) self.download_percent_set_button = wx.Button(self, -1, 'Set Playback Buffer', pos = (20, 110)) #Binds self.Bind(wx.EVT_BUTTON, self.change_save_path, self.save_button) self.Bind(wx.EVT_BUTTON, self.change_mplayer_path, self.mplayer_button) self.Bind(wx.EVT_BUTTON, self.set_playback_buffer, self.download_percent_set_button) # self.Bind(wx.EVT_BUTTON, self.change_buffer, self.change_buffer) def change_save_path(self, event): self.save_dlg = wx.DirDialog(self, 'Select save folder.', 'C:/', name = 'save_dialog') result = self.save_dlg.ShowModal() if result == wx.ID_OK: print 'Changed Path; OK' self.s.music_folder = self.save_dlg.GetPath().replace('\\', '/')+'/' self.display_path.SetValue(self.s.music_folder) if result == wx.ID_CANCEL: pass #User did not select a path, or they select the path and then hit cancel def change_mplayer_path(self, event): self.mplayer_dlg = wx.FileDialog(self, 'Select MPlayer executable.', 'C:/') result = self.mplayer_dlg.ShowModal() if result == wx.ID_OK: print 'Changed MPlayer; OK' input_path = self.mplayer_dlg.GetDirectory().replace('\\', '/') + '/' + self.mplayer_dlg.GetFilename() if os.path.exists(input_path): self.s.mplayer = input_path self.display_mplayer_path.SetValue(self.s.mplayer) else: print 'Path does not exist' def set_playback_buffer(self, event): self.s.download_percent = int( self.download_percent_display.GetValue() ) / 100.0 print 'Buffer: %i' % self.download_percent_display.GetValue() if __name__ == '__main__': app = wx.App(redirect = False) app_window = Main(parent = None, id = -1, title = 'Sharky') app_window.Show() app.SetTopWindow(app_window) reactor.registerWxApp(app) reactor.run()
  20. Ok thanks for the suggestions also please post the grooveshark.log (in the application folder)
  21. How about this, its both of their faults, as well as the US and Great Britain (mostly the US) that gave Israel the land, but the one thing that could fix this without one side killing the other, is if they learn what every five year old must learn, to share.
  22. According to google it is feasible http://www.google.com/search?sourceid=chro...define:feasible Just a pain in the ass :P, though I get what you were saying about rtmpe. Oh and congrats you have 666 posts ZigZagJoe ;) (well if you don't post anymore before you see this message)
  23. Its possible, you would have to setup a proxy to get the rtmpe url (and the you can either have your own code or use rtmpdump) but it is a LOT harder to implement and also Adobe and Hulu make it a pain in the ass.
  24. New Version http://www.mediafire.com/?1hwzmmjzivm --------- Fixes some bugs Adds updating And other minor features
  25. I have investigated rtmpe A LOT (its what Hulu and CBS use (of course Hulu uses some other mechanisms as well (see XBMC forums) ). rtmpe is a encrypted version of the rtmp protocol, the only really good implementation is rtmpdump (get it on torrents (it has been DMCA'ed etc), also there is an implementation that is being worked on that is written in python as well (rtmpy)
×
×
  • Create New...