Skip to content

Commit b17af4f

Browse files
author
moedje
committed
Updates to WSOnline, and new addon module script.module.pycliper a clipboard python module.
1 parent 07eb3e2 commit b17af4f

File tree

23 files changed

+612
-21
lines changed

23 files changed

+612
-21
lines changed

addons.xml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ REQUIRED [B]Script.Module.URLResolver, Simple.Downloader, YouTubeDL, and KODIswi
210210
</extension>
211211
</addon>
212212

213-
<addon id="plugin.video.wsonline" name="WatchSeries-Online" version="1.5.1" provider-name="moedje">
213+
<addon id="plugin.video.wsonline" name="WatchSeries-Online" version="1.6.0" provider-name="moedje">
214214
<requires>
215215
<import addon="xbmc.python" version="2.24.0"/>
216216
<import addon="script.module.requests" optional="false"/>
@@ -227,7 +227,7 @@ REQUIRED [B]Script.Module.URLResolver, Simple.Downloader, YouTubeDL, and KODIswi
227227
<summary>Watchseries-online TV Plugin</summary>
228228
<description>Get the latest TV episodes on Watchseries-Online(.pl/.nl/.la...) and search for a series, list all online
229229
episodes in that series, and play them from Openload.Co or VODlocker
230-
[B]V1.5 2017-2-20:[/B] Parsers have been added to attempt to grab details out of the name of the show such as the date, episode number and season. Formats the listings to be standard for easy sorting and reading through including color to make date stand out. V1.2.0 2018-02-14: New playback and video file resolving fixing many bugs. Source Sorting and fave sources can be set in settings. Updated to new watchseries-online host which is currently .PL and added this as a setting that can be changed in the addon so I don't have to release an update each time they move servers.
230+
[B]V1.6.0 2017-4-5:[/B] Minor fixes/changes to make Save Show and Remove show work better. Make Search Show work as currently doesn't. V1.5 2017-2-20: Parsers have been added to attempt to grab details out of the name of the show such as the date, episode number and season. Formats the listings to be standard for easy sorting and reading through including color to make date stand out. V1.2.0 2018-02-14: New playback and video file resolving fixing many bugs. Source Sorting and fave sources can be set in settings. Updated to new watchseries-online host which is currently .PL and added this as a setting that can be changed in the addon so I don't have to release an update each time they move servers.
231231
</description>
232232
</extension>
233233
</addon>
@@ -245,4 +245,22 @@ REQUIRED [B]Script.Module.URLResolver, Simple.Downloader, YouTubeDL, and KODIswi
245245
<platform>all</platform>
246246
</extension>
247247
</addon>
248+
249+
<addon id="script.module.pyperclip"
250+
name="pyperclip"
251+
version="1.5.27"
252+
provider-name="moedje">
253+
<requires>
254+
<import addon="xbmc.python" version="2.1.0"/>
255+
</requires>
256+
<extension point="xbmc.python.module" library="lib"/>
257+
<extension point="xbmc.addon.metadata">
258+
<summary>Clipboard Python Module</summary>
259+
<description>Cross Platform Python Module for interacting with the clipboard from https://github.com/asweigart/pyperclip Packaged as a module to allow XBMC / Kodi to interact with the clipboard.</description>
260+
<platform>all</platform>
261+
<license>Simplified BSD</license>
262+
<source>https://github.com/asweigart/pyperclip.git</source>
263+
<website>https://pypi.python.org/pypi/pyperclip</website>
264+
</extension>
265+
</addon>
248266
</addons>

addons.xml.md5

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
21a6af922d8d1f3453a8fd948baf9616
1+
06bbb77cf9313768333596550e57ecf7

plugin.video.wsonline/addon.py

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,13 @@ def index():
2626
itemsaved = {'label': 'Saved Shows', 'path': plugin.url_for(saved), 'icon': 'DefaultFolder.png', 'thumbnail': 'DefaultFolder.png'}
2727
itemplay = {'label': 'Resolve URL and Play (URLresolver required)', 'path': plugin.url_for(playurl), 'icon': 'DefaultFolder.png', 'thumbnail': 'DefaultFolder.png'}
2828
itemlatest = {'label': 'Last 350 Episodes', 'icon': 'DefaultFolder.png', 'thumbnail': 'DefaultFolder.png', 'path': plugin.url_for(latest)}
29-
itemsearch = {'label': 'Search', 'icon': __imgsearch__, 'thumbnail': __imgsearch__, 'path': plugin.url_for(search)}
29+
itemsearch = {'label': 'Search', 'icon': __imgsearch__, 'thumbnail': __imgsearch__, 'path': plugin.url_for(search, paste=False)}
30+
itemsearchpasted = {'label': 'Search (Paste Clipboard)', 'icon': __imgsearch__, 'thumbnail': __imgsearch__, 'path': plugin.url_for(search, paste=True)}
31+
3032
litems.append(itemlatest)
31-
litems.append(itemsearch)
3233
litems.append(itemsaved)
34+
litems.append(itemsearch)
35+
litems.append(itemsearchpasted)
3336
litems.append(itemplay)
3437
return litems
3538

@@ -50,6 +53,8 @@ def loadsaved():
5053
return []
5154
for item in sitems:
5255
li = ListItem.from_dict(**item)
56+
li.add_context_menu_items(
57+
[('Remove Saved Show', 'RunPlugin("{0}")'.format(plugin.url_for(removeshow, name=li.label, link=li.label2)),)])
5358
litems.append(li)
5459
except:
5560
pass
@@ -116,6 +121,24 @@ def saveshow(name='', link=''):
116121
plugin.notify(msg="ERROR save failed for {0}".format(name), title=link)
117122

118123

124+
@plugin.route('/saveshowfromepisode/<name>/<link>')
125+
def saveshowfromepisode(name='', link=''):
126+
'''
127+
Loads the episode page and searches html for the category for the entire show not this specific episode to then save the show using the same show function used when we alreaedy know the category.
128+
<span class="info-category"><a href="https://watchseries-online.pl/category/late-night-with-seth-meyers" rel="category tag">Late Night with Seth Meyers</a></span>
129+
'''
130+
html = DL(link)
131+
matches = re.compile(ur'span class="info-category">.+?href="(http.+?[^"])".+?>(.+?[^<])</a>', re.DOTALL+re.S+re.U).findall(html)
132+
litems = []
133+
categorylink = ''
134+
showname = ''
135+
if matches is not None:
136+
for showlink, catname in matches:
137+
categorylink = showlink
138+
showname = catname
139+
saveshow(name=showname, link=categorylink)
140+
141+
119142
@plugin.route('/removeshow/<name>/<link>')
120143
def removeshow(name='', link=''):
121144
sitems = []
@@ -244,7 +267,10 @@ def episode_makeitem(episodename, episodelink):
244267
item.setdefault(item.keys()[0])
245268
li = ListItem.from_dict(**item)
246269
li.set_info(type='video', info_labels=infolbl)
247-
li.add_context_menu_items([('Search [B]{0}[/B]'.format(eptitle), 'RunPlugin({0})'.format(plugin.url_for(query, searchquery=eptitle)),)])
270+
ctxitems = [('Search [B]{0}[/B]'.format(eptitle), 'RunPlugin({0})'.format(plugin.url_for(queryshow, searchquery=eptitle)),)]
271+
ctxitems.append([('Save Show', 'RunPlugin("{0}")'.format(plugin.url_for(saveshowfromepisode, name=li.label, link=episodelink)),)])
272+
ctxitems.append(li.get_context_menu_items())
273+
li.add_context_menu_items(items=ctxitems, replace_items=True)
248274
except:
249275
li = ListItem(label=episodename, label2=episodelink, icon=img, thumbnail=img, path=spath)
250276
return li
@@ -263,25 +289,45 @@ def latest():
263289
return litems
264290

265291

266-
@plugin.route('/search')
267-
def search():
292+
293+
@plugin.route('/search/<paste>')
294+
def search(paste=False):
268295
searchtxt = ''
269-
searchtxt = plugin.get_setting('lastsearch')
296+
if paste:
297+
try:
298+
import pycliper
299+
searchtxt = pycliper.clipboard.paste()
300+
except:
301+
searchtxt = ''
302+
else:
303+
searchtxt = plugin.get_setting('lastsearch')
270304
searchtxt = plugin.keyboard(searchtxt, 'Search All Sites', False)
271305
searchquery = searchtxt.replace(' ', '+')
272306
plugin.set_setting(key='lastsearch', val=searchtxt)
273-
return query(searchquery)
307+
query(searchquery)
308+
309+
310+
@plugin.route('/queryshow/<searchquery>')
311+
def queryshow(searchquery):
312+
#plugin.add_items(items=query(searchquery))
313+
plugin.clear_added_items()
314+
resitems = query(searchquery)
315+
return plugin.finish(items=resitems, succeeded=True, update_listing=True)
274316

275317

276318
@plugin.route('/query/<searchquery>')
277319
def query(searchquery):
320+
searchquery = searchquery.replace(' ', '+')
278321
urlsearch = __BASEURL__ + '/?s={0}&search='.format(searchquery)
279322
html = DL(urlsearch)
280323
htmlres = html.partition('<div class="ddmcc">')[2].split('</div>',1)[0]
281324
matches = re.compile(ur'href="(http.+watchseries-online.+/category.+?[^"])".+?[^>]>(.+?[^<])<.a>', re.DOTALL + re.S + re.U).findall(htmlres)
282325
litems = []
283326
for slink, sname in matches:
284327
litems.append(makecatitem(sname, slink))
328+
#plugin.add_items(litems)
329+
plugin.notify(msg="Search {0}".format(urlsearch), title="Found: {0} {1}".format(str(len(litems)), searchquery))
330+
#plugin.ad(litems, update_listing=True)
285331
return litems
286332

287333

plugin.video.wsonline/addon.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2-
<addon id="plugin.video.wsonline" name="WatchSeries-Online" version="1.5.1" provider-name="moedje">
2+
<addon id="plugin.video.wsonline" name="WatchSeries-Online" version="1.6.0" provider-name="moedje">
33
<requires>
44
<import addon="xbmc.python" version="2.24.0"/>
55
<import addon="script.module.requests" optional="false"/>
@@ -16,7 +16,7 @@
1616
<summary>Watchseries-online TV Plugin</summary>
1717
<description>Get the latest TV episodes on Watchseries-Online(.pl/.nl/.la...) and search for a series, list all online
1818
episodes in that series, and play them from Openload.Co or VODlocker
19-
[B]V1.5 2017-2-20:[/B] Parsers have been added to attempt to grab details out of the name of the show such as the date, episode number and season. Formats the listings to be standard for easy sorting and reading through including color to make date stand out. V1.2.0 2018-02-14: New playback and video file resolving fixing many bugs. Source Sorting and fave sources can be set in settings. Updated to new watchseries-online host which is currently .PL and added this as a setting that can be changed in the addon so I don't have to release an update each time they move servers.
19+
[B]V1.6.0 2017-4-5:[/B] Minor fixes/changes to make Save Show and Remove show work better. Make Search Show work as currently doesn't. V1.5 2017-2-20: Parsers have been added to attempt to grab details out of the name of the show such as the date, episode number and season. Formats the listings to be standard for easy sorting and reading through including color to make date stand out. V1.2.0 2018-02-14: New playback and video file resolving fixing many bugs. Source Sorting and fave sources can be set in settings. Updated to new watchseries-online host which is currently .PL and added this as a setting that can be changed in the addon so I don't have to release an update each time they move servers.
2020
</description>
2121
</extension>
2222
</addon>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
V 1.6.0 (2017-04-05)
2+
- Bug Fixes to Save Show/Remove Show
3+
- Search Show Fixes
4+
- Save Show Adding to Main Episode List
5+
6+
V 1.5.0 (2017-02-20)
7+
- Added parser to get details from the linked show
8+
- Added formatter to label the show name with color for details parser has found
9+
- Parser tries to find a date in a few formats and Season and Episode Number.
10+
11+
V 1.2.0 (2017-02-15)
12+
- Added setting for favourite file sources
13+
- Uses sources in settings to sort them to top of list
14+
- Fixed problem with url request getting access denied from new .PL server by using REQUESTS module
15+
16+
V 1.1.0 (2017-02-14)
17+
- Hostname changed to watchseries-online.pl
18+
- Added setting for addon to specify the current hostname

plugin.video.wsonline/changelog.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
V 1.6.0 (2017-04-05)
2+
- Bug Fixes to Save Show/Remove Show
3+
- Search Show Fixes
4+
- Save Show Adding to Main Episode List
5+
16
V 1.5.0 (2017-02-20)
27
- Added parser to get details from the linked show
38
- Added formatter to label the show name with color for details parser has found
Binary file not shown.

script.module.pyperclip/addon.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<addon id="script.module.pyperclip"
3+
name="pyperclip"
4+
version="1.5.27"
5+
provider-name="moedje">
6+
<requires>
7+
<import addon="xbmc.python" version="2.1.0"/>
8+
</requires>
9+
<extension point="xbmc.python.module" library="lib"/>
10+
<extension point="xbmc.addon.metadata">
11+
<summary>Clipboard Python Module</summary>
12+
<description>Cross Platform Python Module for interacting with the clipboard from https://github.com/asweigart/pyperclip Packaged as a module to allow XBMC / Kodi to interact with the clipboard.</description>
13+
<platform>all</platform>
14+
<license>Simplified BSD</license>
15+
<source>https://github.com/asweigart/pyperclip.git</source>
16+
<website>https://pypi.python.org/pypi/pyperclip</website>
17+
</extension>
18+
</addon>

script.module.pyperclip/icon.png

50.2 KB
Loading

0 commit comments

Comments
 (0)