...
 
Commits (6)
from audio_services import matches_url
import json
import re
import urllib
import youtube_utils
import requests
@matches_url('https://audioboom.com')
def convert_audioboom(url):
......@@ -14,16 +14,14 @@ def convert_audioboom(url):
@matches_url ('https://soundcloud.com/')
def convert_soundcloud (url):
client_id = "df8113ca95c157b6c9731f54b105b473"
permalink = urllib.urlopen ('http://api.soundcloud.com/resolve.json?client_id=%s&url=%s' %(client_id, url))
if permalink.getcode () == 404:
permalink.close ()
raise TypeError('%r is not a valid URL' % url)
else:
resolved_url = permalink.geturl ()
permalink.close ()
track_url = urllib.urlopen (resolved_url)
track_data = json.loads (track_url.read ())
track_url.close ()
with requests.get('http://api.soundcloud.com/resolve.json', client_id=client_id, url=url) as permalink:
if permalink.status_code==404:
raise TypeError('%r is not a valid URL' % permalink.url)
else:
resolved_url = permalink.url
with requests.get(resolved_url) as track_url:
track_data = track_url.json()
if track_data ['streamable']:
return track_data ['stream_url'] + "?client_id=%s" %client_id
else:
......
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
import time
import platform
if platform.system() == "Windows":
......@@ -17,7 +17,7 @@ import config
import sound
import languageHandler
import logging
import youtube_utils
from audio_services import youtube_utils
from controller.buffers import baseBuffers
from sessions.twitter import compose, utils
from mysc.thread_utils import call_threaded
......
......@@ -4,7 +4,7 @@ import platform
system = platform.system()
import application
import requests
import youtube_utils
from audio_services import youtube_utils
import arrow
if system == "Windows":
from update import updater
......
......@@ -11,7 +11,7 @@ import audio_services
import paths
import sound_lib
import output
import youtube_utils
from audio_services import youtube_utils
import application
system = platform.system()
if system=="Windows" and not hasattr(sys, 'frozen'): # We are running from source on Windows
......
This diff is collapsed.
......@@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2018-08-15 09:30+Hora de verano central (Mexico)\n"
"POT-Creation-Date: 2019-03-17 13:34+Hora estándar romance\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......
This diff is collapsed.
Subproject commit c80247f5e1e8aba6fbbad4d20cf7c7fced6f51f6
Subproject commit dc70dde77ef8e0999f4ae6e32f43e7e67d07e2f5