This repository has been archived by the owner on Jun 30, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add interface
list_song_standby
for library
- Loading branch information
Showing
13 changed files
with
206 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
fuocore 使用示例 | ||
================ | ||
|
||
这些使用例子一方面是作为使用参考;另一方面为开发者调试测试提供实例。 | ||
|
||
在 shell.py 中构造一些典型的使用场景,开发者可以使用 `ipython -i shell.py` 进行一些测试。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#! /usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
|
||
import logging | ||
from fuocore.library import Library | ||
|
||
from fuocore.xiami import provider as xp | ||
from fuocore.netease import provider as np | ||
from fuocore.qqmusic import provider as lp | ||
|
||
logging.basicConfig() | ||
logger = logging.getLogger('fuocore') | ||
logger.setLevel(logging.DEBUG) | ||
|
||
lib = Library() | ||
lib.register(xp) | ||
lib.register(np) | ||
lib.register(lp) | ||
|
||
|
||
def test_list_song_standby(): | ||
""" | ||
使用 library.list_song_standby 接口 | ||
""" | ||
result = xp.search('小小恋歌 新垣结衣', limit=2) | ||
song = result.songs[0] # 虾米音乐没有这首歌的资源 | ||
assert song.url == '' | ||
|
||
standby_songs = lib.list_song_standby(song) | ||
for index, ss in enumerate(standby_songs): # pylint: disable=all | ||
print(index, ss.source, ss.title, ss.artists_name, ss.url) | ||
|
||
|
||
def main(): | ||
test_list_song_standby() | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#! /usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
|
||
import logging | ||
from fuocore.library import Library | ||
|
||
from fuocore.xiami import provider as xp | ||
from fuocore.netease import provider as np | ||
from fuocore.qqmusic import provider as lp | ||
|
||
logging.basicConfig() | ||
logger = logging.getLogger('fuocore') | ||
logger.setLevel(logging.DEBUG) | ||
|
||
lib = Library() | ||
lib.register(xp) | ||
lib.register(np) | ||
lib.register(lp) | ||
|
||
library = lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.