|
@@ -12,26 +12,20 @@ class NetAxiosUtil{
|
|
|
|
|
|
|
|
|
|
|
|
|
async getLyric(title:string,artist:string,isApi2:boolean): Promise<string>{
|
|
async getLyric(title:string,artist:string,isApi2:boolean): Promise<string>{
|
|
|
- if(StrUtil.isNotEmpty(title)&&title==='全世界最好的你'){
|
|
|
|
|
- artist = ''
|
|
|
|
|
- }
|
|
|
|
|
- let baseUrl = PreferencesUtil.getStringSync('LRC_API')
|
|
|
|
|
- if (baseUrl=='') {
|
|
|
|
|
- LogUtil.debug("Heanup 未设置API");
|
|
|
|
|
- return ''
|
|
|
|
|
- }
|
|
|
|
|
- let requestUrl = baseUrl
|
|
|
|
|
- + '?title=' + encodeURIComponent(title.trim()) + '&artist=' + encodeURIComponent(artist.trim());
|
|
|
|
|
-
|
|
|
|
|
- LogUtil.debug("Heanup requestUrl =" + requestUrl + '; title = '+title+'; artist = '+artist)
|
|
|
|
|
- // if(isApi2){
|
|
|
|
|
- // requestUrl = CommonConstants.LRC_API_2
|
|
|
|
|
- // + '?title=' + encodeURIComponent(title.trim()) + '&artist=' + encodeURIComponent(artist.trim());
|
|
|
|
|
- // }
|
|
|
|
|
- // LogUtil.debug("onecold requestUrl =" + requestUrl + ' title = '+title+' artist = '+artist)
|
|
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
|
|
+ if(StrUtil.isNotEmpty(title)&&title==='全世界最好的你'){
|
|
|
|
|
+ artist = ''
|
|
|
|
|
+ }
|
|
|
|
|
+ let baseUrl = PreferencesUtil.getStringSync('LRC_API','')
|
|
|
|
|
+ if (baseUrl=='') {
|
|
|
|
|
+ LogUtil.debug("Heanup 未设置API");
|
|
|
|
|
+ return ''
|
|
|
|
|
+ }
|
|
|
|
|
+ let requestUrl = baseUrl
|
|
|
|
|
+ + '?title=' + encodeURIComponent(title.trim()) + '&artist=' + encodeURIComponent(artist.trim());
|
|
|
|
|
|
|
|
|
|
+ LogUtil.debug("Heanup requestUrl =" + requestUrl + '; title = '+title+'; artist = '+artist)
|
|
|
|
|
|
|
|
const httpRequest = http.createHttp();
|
|
const httpRequest = http.createHttp();
|
|
|
const options: http.HttpRequestOptions = {
|
|
const options: http.HttpRequestOptions = {
|
|
@@ -68,15 +62,15 @@ class NetAxiosUtil{
|
|
|
|
|
|
|
|
|
|
|
|
|
async getLyricCover(title: string, artist: string): Promise<string> {
|
|
async getLyricCover(title: string, artist: string): Promise<string> {
|
|
|
- let baseUrl = PreferencesUtil.getStringSync('COVER_API')
|
|
|
|
|
- if (baseUrl=='') {
|
|
|
|
|
- LogUtil.debug("Heanup 未设置API");
|
|
|
|
|
- return ''
|
|
|
|
|
- }
|
|
|
|
|
- const cover_url = baseUrl
|
|
|
|
|
- + '?title=' + encodeURIComponent(title.trim()) + '&artist=' + encodeURIComponent(artist.trim());
|
|
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
|
|
+ let baseUrl = PreferencesUtil.getStringSync('COVER_API','')
|
|
|
|
|
+ if ( baseUrl=='') {
|
|
|
|
|
+ LogUtil.debug("Heanup 未设置API");
|
|
|
|
|
+ return ''
|
|
|
|
|
+ }
|
|
|
|
|
+ const cover_url = baseUrl
|
|
|
|
|
+ + '?title=' + encodeURIComponent(title.trim()) + '&artist=' + encodeURIComponent(artist.trim());
|
|
|
const httpRequest = http.createHttp();
|
|
const httpRequest = http.createHttp();
|
|
|
const options: http.HttpRequestOptions = {
|
|
const options: http.HttpRequestOptions = {
|
|
|
method: http.RequestMethod.GET,
|
|
method: http.RequestMethod.GET,
|