Build Kugou Online Music Player With Webkit

kugou git repo: kugou git

Python 源码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/python

# Copyright (C) 2012 mutse <yyhoo2.young@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#

import gtk
import webkit

import sys

class WebKugou(gtk.Window):

def __init__(self):
super(WebKugou,self).__init__()

view = webkit.WebView()
vbox = gtk.VBox(spacing=1)
vbox.pack_start(view)
self.add(vbox)

self.set_default_size(800, 600)
self.set_title('Kugou Music')
self.set_position(gtk.WIN_POS_CENTER)

try:
self.set_icon_from_file("/usr/local/share/icons/kugou.png")
except Exception, e:
print e.message
sys.exit(1)

self.connect('destroy', gtk.main_quit)
self.show_all()

view.open("http://web.kugou.com")

if __name__ == "__main__":
WebKugou()
gtk.main()