mirror of
https://github.com/jiojciojsioe3/a3cjroijsiojiorj.git
synced 2024-11-22 19:01:51 +08:00
use urlparse for preview url joining
This commit is contained in:
parent
ef37f127a4
commit
1619622257
5
app.py
5
app.py
@ -6,6 +6,7 @@ import json
|
|||||||
import sqlite3
|
import sqlite3
|
||||||
import re
|
import re
|
||||||
import os
|
import os
|
||||||
|
import urlparse
|
||||||
from flask import Flask, g, jsonify, render_template, request, abort, redirect
|
from flask import Flask, g, jsonify, render_template, request, abort, redirect
|
||||||
from ffmpy import FFmpeg
|
from ffmpy import FFmpeg
|
||||||
|
|
||||||
@ -145,9 +146,9 @@ def route_api_preview():
|
|||||||
song_type = song_row[0][10]
|
song_type = song_row[0][10]
|
||||||
prev_path = make_preview(song_id, song_type)
|
prev_path = make_preview(song_id, song_type)
|
||||||
if not prev_path:
|
if not prev_path:
|
||||||
return redirect(''.join([request.host_url, '/songs/%s/main.mp3' % song_id]))
|
return redirect(urlparse.urljoin(request.host_url, '/songs/%s/main.mp3' % song_id))
|
||||||
|
|
||||||
return redirect(''.join([request.host_url, '/songs/%s/preview.mp3' % song_id]))
|
return redirect(urlparse.urljoin(request.host_url, '/songs/%s/preview.mp3' % song_id))
|
||||||
|
|
||||||
|
|
||||||
@app.route('/api/songs')
|
@app.route('/api/songs')
|
||||||
|
Loading…
Reference in New Issue
Block a user