Skip to content

Commit d3a7746

Browse files
initial commit
0 parents  commit d3a7746

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+28287
-0
lines changed

Images/Detached_Mode.png

272 KB
Loading

Images/Music.png

386 KB
Loading

Images/Thumbnail.png

494 KB
Loading

Images/Video.png

317 KB
Loading

Images/Watch.png

419 KB
Loading

Images/YT.png

296 KB
Loading

LICENSE

+674
Large diffs are not rendered by default.

MANIFEST.in

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
include kawaii_player/default.jpg
2+
include kawaii_player/kawaii-player-start
3+
include kawaii_player/introspect.xml
4+
include kawaii_player/kawaii-player.desktop
5+
include kawaii_player/Instructions
6+
include kawaii_player/1.png
7+
include kawaii_player/input.conf
8+
include kawaii_player/tray.png
9+
include kawaii_player/kawaii-player
10+
include kawaii_player/playlist.html

README.md

+607
Large diffs are not rendered by default.

arch/PKGBUILD

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
pkgname=kawaii-player
2+
_pkgname=kawaii-player
3+
pkgver=1.0.0
4+
pkgrel=0
5+
pkgdesc="An Audio/Video Manager and Front End for mpv/mplayer with special emphasis on Anime Collection"
6+
arch=(any)
7+
conflicts=('kawaii-player-git')
8+
license=('GPL3')
9+
depends=('python' 'qt5-webengine' 'python-pyqt5' 'python-pycurl' 'curl' 'libnotify' 'python-dbus' 'libtorrent-rasterbar'
10+
'python-beautifulsoup4' 'python-psutil' 'python-pillow' 'python-lxml' 'mpv' 'mplayer' 'ffmpegthumbnailer' 'sqlite3' 'python-pytaglib'
11+
'youtube-dl' 'wget')
12+
13+
makedepends=('git')
14+
15+
source=("https://github.com/kanishka-linux/${_pkgname}/releases/download/v${pkgver}-${pkgrel}/${_pkgname}-${pkgver}-${pkgrel}.tar.bz2")
16+
md5sums=('SKIP')
17+
_gitname=kawaii_player
18+
19+
20+
package() {
21+
22+
_bpath="${srcdir}/${_pkgname}-${pkgver}-${pkgrel}/${_gitname}"
23+
24+
install -d "${pkgdir}/usr/share/${_pkgname}/"
25+
install -d "${pkgdir}/usr/share/${_pkgname}/Plugins/"
26+
install -d "${pkgdir}/usr/share/applications/"
27+
install -d "${pkgdir}/usr/bin/"
28+
29+
for file in "${_bpath}/"*;do
30+
nm=$(echo $file | rev | cut -d'/' -f1 | rev)
31+
if [ -d "$file" ];then
32+
if [ $nm == 'Plugins' ];then
33+
_plugin_path="$file/"
34+
for plugins in "${_plugin_path}"*;do
35+
plugin_name=$(echo $plugins | rev | cut -d'/' -f1 | rev)
36+
if [ plugin_name != 'installPlugins.py' ];then
37+
echo $plugins
38+
echo 'Plugins copying'
39+
install -Dm755 "$plugins" "${pkgdir}/usr/share/${_pkgname}/Plugins/"
40+
fi
41+
done
42+
fi
43+
else
44+
if [ $nm == 'kawaii-player.desktop' ];then
45+
echo $file
46+
echo 'desktop file copying'
47+
cat "$file" | sed 's/Exec=/Exec=python -B \/usr\/share\/kawaii-player\/kawaii_player.py \%f/g' > "${pkgdir}/usr/share/applications/kawaii-player.desktop"
48+
elif [ $nm == 'kawaii-player' ];then
49+
echo $file
50+
echo 'kawaii-player script'
51+
install -Dm755 "$file" "${pkgdir}/usr/bin/kawaii-player"
52+
chmod +x "${pkgdir}/usr/bin/kawaii-player"
53+
else
54+
if [ $nm != 'install.py' ];then
55+
echo $file
56+
echo 'source files copying'
57+
install -Dm755 "$file" "${pkgdir}/usr/share/${_pkgname}/"
58+
fi
59+
fi
60+
fi
61+
done
62+
63+
}

arch/PKGBUILD.git

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
pkgname=kawaii-player-git
2+
_pkgname=kawaii-player
3+
pkgver=0.0.0.r31.fffb7b9
4+
pkgrel=1
5+
pkgdesc="An Audio/Video Manager and Front End for mpv/mplayer with special emphasis on Anime Collection"
6+
arch=(any)
7+
conflicts=('kawaii-player')
8+
license=('GPL3')
9+
depends=('python' 'qt5-webengine' 'python-pyqt5' 'python-pycurl' 'curl' 'libnotify' 'python-dbus' 'libtorrent-rasterbar'
10+
'python-beautifulsoup4' 'python-psutil' 'python-pillow' 'python-lxml' 'mpv' 'mplayer' 'ffmpegthumbnailer' 'sqlite3' 'python-pytaglib'
11+
'youtube-dl' 'wget')
12+
#optdepends=('livestreamer' 'youtube-dl' 'wget')
13+
makedepends=('git')
14+
15+
source=("git+https://github.com/kanishka-linux/kawaii-player.git")
16+
17+
md5sums=('SKIP')
18+
_gitname=kawaii_player
19+
20+
21+
package() {
22+
23+
_bpath="${srcdir}/kawaii-player/${_gitname}"
24+
25+
install -d "${pkgdir}/usr/share/${_pkgname}/"
26+
install -d "${pkgdir}/usr/share/${_pkgname}/Plugins/"
27+
install -d "${pkgdir}/usr/share/applications/"
28+
install -d "${pkgdir}/usr/bin/"
29+
30+
for file in "${_bpath}/"*;do
31+
nm=$(echo $file | rev | cut -d'/' -f1 | rev)
32+
if [ -d "$file" ];then
33+
if [ $nm == 'Plugins' ];then
34+
_plugin_path="$file/"
35+
for plugins in "${_plugin_path}"*;do
36+
plugin_name=$(echo $plugins | rev | cut -d'/' -f1 | rev)
37+
if [ plugin_name != 'installPlugins.py' ];then
38+
echo $plugins
39+
echo 'Plugins copying'
40+
install -Dm755 "$plugins" "${pkgdir}/usr/share/${_pkgname}/Plugins/"
41+
fi
42+
done
43+
fi
44+
else
45+
if [ $nm == 'kawaii-player.desktop' ];then
46+
echo $file
47+
echo 'desktop file copying'
48+
cat "$file" | sed 's/Exec=/Exec=python -B \/usr\/share\/kawaii-player\/kawaii_player.py \%f/g' > "${pkgdir}/usr/share/applications/kawaii-player.desktop"
49+
elif [ $nm == 'kawaii-player' ];then
50+
echo $file
51+
echo 'kawaii-player script'
52+
install -Dm755 "$file" "${pkgdir}/usr/bin/kawaii-player"
53+
chmod +x "${pkgdir}/usr/bin/kawaii-player"
54+
else
55+
if [ $nm != 'install.py' ];then
56+
echo $file
57+
echo 'source files copying'
58+
install -Dm755 "$file" "${pkgdir}/usr/share/${_pkgname}/"
59+
fi
60+
fi
61+
fi
62+
done
63+
64+
}

kawaii_player/1.png

195 KB
Loading

kawaii_player/Instructions

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
dependencies=('python3' 'qt5-webengine' 'python3-pyqt5' 'python3-pycurl' 'python3-urllib3' 'curl' 'libnotify' 'libtorrent-rasterbar' 'python3-dbus'
2+
'python3-beautifulsoup4' 'python3-psutil' 'python3-pillow' 'python3-lxml' 'mpv' 'mplayer' 'ffmpegthumbnailer' 'sqlite3' 'python3-pytaglib' 'youtube-dl' 'livestreamer' ' wget')
3+
4+
In some distributions more dependencies might be required which are listed below
5+
6+
('python3-livestreamer' 'python3-libtorrent' 'python3-dbus.mainloop.pyqt5' 'python3-pyqt5.qtwebkit')
7+
8+
Name of dependencies may vary from distro to distro.
9+
10+
First Remove or uninstall any other version of the AnimeWatch. After uninstall either backup or remove '~/.config/AnimeWatch/src' directory, since it might contain incompatible Addons or plugins, because of which programme might not work.
11+
12+
Make sure qt5-webengine is installed. If qt5-webengine is not packaged in your linux distro then it will fallback to qtwebkit.
13+
14+
Now In the 'AnimeWatch-PyQt5' directory open a terminal and run 'python install.py'. Now application launcher should be created in '~/.local/share/applications/' directory. If application launcher is not working, then directly go to '~/.config/AnimeWatch/src' directory, open terminal and run 'python3 -B animeWatch.py'.
15+
16+
If you don't want't to run 'install.py' script, then you can simply use './animewatch-start' bash script to launch the player directly from within the source folder without copying installation files anywhere on the system. If you are using 'animewatch-start' script then you need to copy manually contents of 'Plugins' folder to the destination '~/.config/AnimeWatch/src/Plugins/' in order to use addons. If there is no default background then copy 'default.jpg' to '~/.config/AnimeWatch' and '1.png' to '~/.config/AnimeWatch/src/'

kawaii_player/Plugins/Shoutcast.py

+170
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
import sys
2+
import urllib
3+
import pycurl
4+
from io import StringIO,BytesIO
5+
import re
6+
import random
7+
import subprocess
8+
from subprocess import check_output
9+
from bs4 import BeautifulSoup
10+
import os
11+
import os.path
12+
from subprocess import check_output
13+
import shutil
14+
import json
15+
from player_functions import ccurl,naturallysorted
16+
17+
18+
class Shoutcast():
19+
def __init__(self,tmp):
20+
self.hdr = 'Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:45.0) Gecko/20100101 Firefox/45.0'
21+
self.tmp_dir = tmp
22+
def getOptions(self):
23+
criteria = ['History','Genre']
24+
return criteria
25+
26+
def getFinalUrl(self,name,epn,mir,quality):
27+
return epn
28+
29+
def process_page(self,content):
30+
content = re.sub(r'\\',"-",content)
31+
#print(content)
32+
#f = open('/tmp/tmp.txt','w')
33+
#f.write(content)
34+
#f.close()
35+
try:
36+
l = json.loads(content)
37+
except:
38+
o = re.findall('{[^}]*}',content)
39+
l = []
40+
for i in o:
41+
print(i)
42+
try:
43+
j = json.loads(i)
44+
print(j['ID'],j['Name'])
45+
l.append(j)
46+
except:
47+
pass
48+
print('----------------------error---------------')
49+
s = []
50+
for i in l:
51+
try:
52+
#print(i['ID'],i['Name'],i['Bitrate'],i['Listeners'])
53+
s.append(i['Name'].replace('/','-')+' id='+str(i['ID'])+'\nBitrate='+str(i['Bitrate'])+'\nListeners='+str(i['Listeners'])+'\n')
54+
except:
55+
pass
56+
return s
57+
58+
def search(self,name):
59+
strname = str(name)
60+
print(strname)
61+
if name.lower() == 'tv':
62+
m = self.getCompleteList(name.upper(),1)
63+
else:
64+
url = "https://www.shoutcast.com/Home/BrowseByGenre"
65+
#content = ccurl(url,name,1)
66+
post = "genrename="+name
67+
content = ccurl(url+'#'+'-d'+'#'+post)
68+
m = self.process_page(content)
69+
return m
70+
71+
def getCompleteList(self,opt,genre_num):
72+
if opt == 'Genre' and genre_num == 0:
73+
url = "http://www.shoutcast.com/"
74+
#content = ccurl(url,"",1)
75+
content = ccurl(url)
76+
m = re.findall('Genre[^"]name[^"]*',content)
77+
#print m
78+
j = 0
79+
for i in m:
80+
m[j] = re.sub('Genre[^"]name=','',i)
81+
m[j] = re.sub("[+]|%20",' ',m[j])
82+
j = j+1
83+
m.sort()
84+
print(m)
85+
#n = ["History","Genre","TV"]
86+
n = ["History","Genre"]
87+
m = n + m
88+
elif opt == 'History':
89+
a =0
90+
elif opt == 'TV':
91+
name = []
92+
track = []
93+
aformat = []
94+
listeners = []
95+
bitrate = []
96+
idr = []
97+
url = "http://thugie.nl/streams.php"
98+
#content = ccurl(url,"",4)
99+
content = ccurl(url)
100+
soup = BeautifulSoup(content,'lxml')
101+
tmp = soup.prettify()
102+
#m = soup.findAll('div',{'class':'boxcenterdir fontstyle'})
103+
#soup = BeautifulSoup(tmp,'lxml')
104+
m = []
105+
links = soup.findAll('div',{'class':'dirOuterDiv1 clearFix'})
106+
for i in links:
107+
j = i.findAll('a')
108+
q = i.find_next('h2')
109+
g = i.find_next('h4')
110+
z = g.find_next('h4')
111+
for k in j:
112+
idr.append(k['href'].split('=')[-1][:-1])
113+
l = i.text
114+
n = re.findall('Station:[^"]*',l)
115+
p = re.sub('Playing','\nPlaying',n[0])
116+
p=p.rstrip()
117+
a = p.split('\n')
118+
name.append(a[0].split(":")[1])
119+
track.append(a[1].split(':')[1])
120+
aformat.append(q.text)
121+
listeners.append(g.text)
122+
bitrate.append(z.text)
123+
for i in range(len(idr)):
124+
m.append(name[i].strip().replace('/','-')+'-TV id='+str(idr[i]).replace('\\','')+'\nBitrate='+str(bitrate[i])+'\nListeners='+str(listeners[i])+'\n')
125+
else:
126+
url = "https://www.shoutcast.com/Home/BrowseByGenre"
127+
#content = ccurl(url,opt,1)
128+
post = 'genrename='+opt
129+
content = ccurl(url+'#'+'-d'+'#'+post)
130+
m = self.process_page(content)
131+
print(opt,url)
132+
return m
133+
134+
def getEpnList(self,name,opt,depth_list,extra_info,siteName,category):
135+
name_id = (re.search('id=[^\n]*',extra_info).group()).split('=')[1]
136+
#nm = name.rsplit('-',1)
137+
#name = nm[0]
138+
#name_id = nm[1]
139+
#name = nm[0]
140+
file_arr = []
141+
id_station = int(name_id)
142+
station_url = ''
143+
if opt == "TV" or '-TV' in name:
144+
url = "http://thugie.nl/streams.php?tunein="+str(id_station)
145+
#content = ccurl(url,'',1)
146+
content = ccurl(url)
147+
final = re.findall('http://[^\n]*',content)
148+
station_url = final[0].rstrip()
149+
if 'stream.nsv' not in station_url:
150+
#print "Hello" + station_url
151+
station_url = str(station_url.rstrip()+";stream.nsv")
152+
153+
154+
else:
155+
url = "https://www.shoutcast.com/Player/GetStreamUrl"
156+
#content = ccurl(url,id_station,2)
157+
post = 'station='+str(id_station)
158+
content = ccurl(url+'#-d#'+post)
159+
m = re.findall('http://[^"]*',content)
160+
station_url = str(m[0])
161+
file_arr.append(name+' '+station_url+' '+'NONE')
162+
#file_arr.append('No.jpg')
163+
#file_arr.append('Summary Not Available')
164+
record_history = True
165+
return (file_arr,'Summary Not Available','No.jpg',record_history,depth_list)
166+
167+
168+
def getNextPage(self,opt,pgn,genre_num,name):
169+
m = []
170+
return m

0 commit comments

Comments
 (0)