Additions to make code more compatible for py2 and py3
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: UTF-8 -*-
|
||||
from __future__ import unicode_literals # at top of module
|
||||
|
||||
class song(object):
|
||||
""" Represents a song in all services. Data will be filled by the service itself"""
|
||||
|
@@ -1,6 +1,10 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: UTF-8 -*-
|
||||
import urllib.parse
|
||||
from __future__ import unicode_literals # at top of module
|
||||
try:
|
||||
import urllib.parse as urlparse
|
||||
except ImportError:
|
||||
import urllib as urlparse
|
||||
import requests
|
||||
import youtube_dl
|
||||
from bs4 import BeautifulSoup
|
||||
@@ -25,7 +29,7 @@ class interface(object):
|
||||
s.title = data[0].text.replace("\n", "").replace("\t", "")
|
||||
# s.artist = data[1].text.replace("\n", "").replace("\t", "")
|
||||
# print(data)
|
||||
s.url = u"https://my.mail.ru"+urllib.parse.quote(data[0].__dict__["attrs"]["href"])
|
||||
s.url = u"https://my.mail.ru"+urlparse.quote(data[0].__dict__["attrs"]["href"])
|
||||
self.results.append(s)
|
||||
|
||||
def get_download_url(self, url):
|
||||
|
@@ -1,4 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals # at top of module
|
||||
import requests
|
||||
from .import baseFile
|
||||
from update.utils import seconds_to_string
|
||||
|
@@ -1,4 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals # at top of module
|
||||
import isodate
|
||||
import youtube_dl
|
||||
from googleapiclient.discovery import build
|
||||
|
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: UTF-8 -*-
|
||||
from __future__ import unicode_literals # at top of module
|
||||
import re
|
||||
import json
|
||||
import requests
|
||||
|
Reference in New Issue
Block a user