mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-07-17 13:46:07 -04:00
a tool to create an installer, fix to play audios using sndup and uploading audios to TwUp
This commit is contained in:
@@ -44,13 +44,13 @@ def convert_twup(url):
|
||||
audio_id = result.group("audio_id")
|
||||
return 'http://twup.me/%s' % audio_id
|
||||
|
||||
@matches_url('http://sndup.net')
|
||||
def convert_sndup(url):
|
||||
result = re.match("^http://sndup.net/(?P<audio_id>[a-z0-9]+/?)(|d|l|a)/?$", url, re.I)
|
||||
if not result or result.group("audio_id") is None:
|
||||
raise TypeError('%r is not a valid URL' % url)
|
||||
audio_id = result.group("audio_id")
|
||||
return 'http://sndup.net/%s/a' % audio_id
|
||||
#@matches_url('http://sndup.net')
|
||||
#def convert_sndup(url):
|
||||
# result = re.match("^http://sndup.net/(?P<audio_id>[a-z0-9]+/?)(|d|l|a)/?$", url, re.I)
|
||||
# if not result or result.group("audio_id") is None:
|
||||
# raise TypeError('%r is not a valid URL' % url)
|
||||
# audio_id = result.group("audio_id")
|
||||
# return 'http://sndup.net/%s/a' % audio_id
|
||||
|
||||
def convert_generic_audio(url):
|
||||
return url
|
||||
|
@@ -68,6 +68,7 @@ class audioDialog(wx.Dialog):
|
||||
services = []
|
||||
if config.main["services"]["dropbox_token"] != "":
|
||||
services.append("Dropbox")
|
||||
services.append("TwUp")
|
||||
services.append("SNDUp")
|
||||
return services
|
||||
|
||||
|
@@ -85,6 +85,9 @@ class textLimited(wx.Dialog):
|
||||
else:
|
||||
url = base_url
|
||||
self.uploader = transfer.Upload(field='file', url=url, filename=self.recording.file, completed_callback=self.upload_completed, wxDialog=self.uploaderDialog)
|
||||
elif self.recording.services.GetValue() == "TwUp":
|
||||
url = 'http://api.twup.me/post.json'
|
||||
self.uploader = transfer.Upload(field='file', url=url, filename=self.recording.file, completed_callback=self.upload_completed, wxDialog=self.uploaderDialog)
|
||||
self.uploaderDialog.Show()
|
||||
self.uploader.perform_threaded()
|
||||
|
||||
|
Reference in New Issue
Block a user