-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathamazon_video.py
45 lines (35 loc) · 1.24 KB
/
amazon_video.py
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
44
__kupfer_name__ = _("AmazonPrime")
__kupfer_actions__ = ("AmazonPrime", )
__description__ = _("Search Amazon Prime")
__version__ = "2018-3"
__author__ = "thorko"
from kupfer.objects import Action, TextLeaf
from kupfer import utils, plugin_support, config
_ALTERNATIVES = (
"google-chrome-stable",
"chromium",
"firefox",
"vivaldi",
)
__kupfer_settings__ = plugin_support.PluginSettings(
{
"key" : "browser_type",
"label": _("Your browser to use"),
"type": str,
"value": "google-chrome-stable",
"alternatives": _ALTERNATIVES,
}
)
class AmazonPrime (Action):
def __init__(self):
Action.__init__(self, _("AmazonPrime"))
def activate(self, leaf):
browser_type = __kupfer_settings__["browser_type"]
searchamazon = [browser_type, 'https://www.amazon.de/s/ref=nb_sb_noss_2?__mk_de_DE=%%C3%%85M%%C3%%85%%C5%%BD%%C3%%95%%C3%%91&url=search-alias%%3Dinstant-video&field-keywords=%s' % leaf.object]
utils.spawn_async(searchamazon)
def item_types(self):
yield TextLeaf
def get_description(self):
return _("Search amazon prime with your browser")
def get_icon_name(self):
return "amazonprime"