Skip to content

Commit

Permalink
Updated URI support
Browse files Browse the repository at this point in the history
  • Loading branch information
AcidWeb committed Apr 3, 2019
1 parent 3d3de43 commit f51dd78
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions CB/Core.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ def parse_url(self, url):
raise NotImplementedError('Provided URL is not supported.')

def add_addon(self, url):
if 'curse://' in url:
url = url.split('/download-client')[0].replace('curse://', 'https://').strip()
if 'twitch://' in url:
url = url.split('/download-client')[0].replace('twitch://', 'https://').strip()
addon = self.check_if_installed(url)
if not addon:
new = self.parse_url(url)
Expand Down Expand Up @@ -217,10 +217,10 @@ def search(self, query):

def create_reg(self):
with open('CurseBreaker.reg', 'w') as outfile:
outfile.write('Windows Registry Editor Version 5.00\n[HKEY_CURRENT_USER\Software\Classes\curse]\n"URL Proto'
'col"="\\"\\""\n@="\\"URL:CurseBreaker Protocol\\""\n[HKEY_CURRENT_USER\Software\Classes\curs'
'e\DefaultIcon]\n@="\\"CurseBreaker.exe,1\\""\n[HKEY_CURRENT_USER\Software\Classes\curse\shel'
'l]\n[HKEY_CURRENT_USER\Software\Classes\curse\shell\open]\n[HKEY_CURRENT_USER\Software\Class'
'es\curse\shell\open\command]\n@="\\"' + os.path.abspath(sys.executable).replace('\\', '\\\\')
+ '\\" \\"%1\\""')
outfile.write('Windows Registry Editor Version 5.00\n[HKEY_CURRENT_USER\Software\Classes\\twitch]\n"URL Pro'
'tocol"="\\"\\""\n@="\\"URL:CurseBreaker Protocol\\""\n[HKEY_CURRENT_USER\Software\Classes\\t'
'witch\DefaultIcon]\n@="\\"CurseBreaker.exe,1\\""\n[HKEY_CURRENT_USER\Software\Classes\\twitc'
'h\shell]\n[HKEY_CURRENT_USER\Software\Classes\\twitch\shell\open]\n[HKEY_CURRENT_USER\Softwa'
're\Classes\\twitch\shell\open\command]\n@="\\"'
+ os.path.abspath(sys.executable).replace('\\', '\\\\') + '\\" \\"%1\\""')

2 changes: 1 addition & 1 deletion CB/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '1.4.0'
__version__ = '1.4.1'
__license__ = 'GPLv3'
__copyright__ = '2019, Paweł Jastrzębski <[email protected]>'
__docformat__ = 'restructuredtext en'
Expand Down
2 changes: 1 addition & 1 deletion CurseBreaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def start(self):
self.setup_completer()
self.setup_table()
# Curse URI Support
if len(sys.argv) == 2 and 'curse://' in sys.argv[1]:
if len(sys.argv) == 2 and 'twitch://' in sys.argv[1]:
try:
self.c_install(sys.argv[1].strip())
except Exception as e:
Expand Down

0 comments on commit f51dd78

Please sign in to comment.