Skip to content
This repository has been archived by the owner on Apr 30, 2019. It is now read-only.

Commit

Permalink
Update 12/12/16
Browse files Browse the repository at this point in the history
Fix for issue #18
Fix for issue for downloading hash files
Added android 7zip binary (still in work)
Added 7zip support for libreelec systems (with virtual.system-tools
add-on)
Added MAME “All Killer No Filler” list
(http://forum.arcadecontrols.com/index.php?topic=149708.0)
  • Loading branch information
Zach Morris authored and Zach Morris committed Dec 12, 2016
1 parent 0f27b11 commit 624af8e
Show file tree
Hide file tree
Showing 7 changed files with 14,710 additions and 19 deletions.
39 changes: 23 additions & 16 deletions addon.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,25 +195,32 @@
iarl_data['settings']['ia_enable_login'] = False #Default to False if not initialized correctly

#Define path to 7za binary
if 'OSX' in iarl_data['addon_data']['operating_system']:
iarl_data['addon_data']['7za_path'] = os.path.join(iarl_data['addon_data']['addon_bin_path'],'7za','7za.OSX')
elif 'Windows' in iarl_data['addon_data']['operating_system']:
iarl_data['addon_data']['7za_path'] = os.path.join(iarl_data['addon_data']['addon_bin_path'],'7za','7za.exe')
elif 'Nix' in iarl_data['addon_data']['operating_system']:
iarl_data['addon_data']['7za_path'] = os.path.join(iarl_data['addon_data']['addon_bin_path'],'7za','7za.Nix')
elif 'OpenElec RPi' in iarl_data['addon_data']['operating_system'] or 'Android' in iarl_data['addon_data']['operating_system'] or 'LibreElec RPi' in iarl_data['addon_data']['operating_system']:
if xbmc.getCondVisibility('System.HasAddon(virtual.system-tools)'):
try:
if 'v7' in os.uname()[4]:
iarl_data['addon_data']['7za_path'] = os.path.join(iarl_data['addon_data']['addon_bin_path'],'7za','7za.armv7l')
else:
iarl_data['addon_data']['7za_path'] = os.path.join(iarl_data['addon_data']['addon_bin_path'],'7za','7za.armv6l')
iarl_data['addon_data']['7za_path'] = xbmc.translatePath('special://home/addons/virtual.system-tools/bin/7za')
xbmc.log(msg='IARL: 7ZA Path was found in virtual.system-tools', level=xbmc.LOGDEBUG)
except:
iarl_data['addon_data']['7za_path'] = os.path.join(iarl_data['addon_data']['addon_bin_path'],'7za','7za.armv6l')
elif 'OpenElec x86' in iarl_data['addon_data']['operating_system'] or 'LibreElec x86' in iarl_data['addon_data']['operating_system']:
iarl_data['addon_data']['7za_path'] = os.path.join(iarl_data['addon_data']['addon_bin_path'],'7za','7za.x86_64')
xbmc.log(msg='IARL: virtual.system-tools was found but the path could not be defined', level=xbmc.LOGDEBUG)
else:
iarl_data['addon_data']['7za_path'] = None
xbmc.log(msg='IARL: 7ZA Path could not be defined', level=xbmc.LOGDEBUG)
if 'OSX' in iarl_data['addon_data']['operating_system']:
iarl_data['addon_data']['7za_path'] = os.path.join(iarl_data['addon_data']['addon_bin_path'],'7za','7za.OSX')
elif 'Windows' in iarl_data['addon_data']['operating_system']:
iarl_data['addon_data']['7za_path'] = os.path.join(iarl_data['addon_data']['addon_bin_path'],'7za','7za.exe')
elif 'Nix' in iarl_data['addon_data']['operating_system']:
iarl_data['addon_data']['7za_path'] = os.path.join(iarl_data['addon_data']['addon_bin_path'],'7za','7za.Nix')
elif 'OpenElec RPi' in iarl_data['addon_data']['operating_system'] or 'Android' in iarl_data['addon_data']['operating_system'] or 'LibreElec RPi' in iarl_data['addon_data']['operating_system']:
try:
if 'v7' in os.uname()[4]:
iarl_data['addon_data']['7za_path'] = os.path.join(iarl_data['addon_data']['addon_bin_path'],'7za','7za.armv7l')
else:
iarl_data['addon_data']['7za_path'] = os.path.join(iarl_data['addon_data']['addon_bin_path'],'7za','7za.armv6l')
except:
iarl_data['addon_data']['7za_path'] = os.path.join(iarl_data['addon_data']['addon_bin_path'],'7za','7za.armv6l')
elif 'OpenElec x86' in iarl_data['addon_data']['operating_system'] or 'LibreElec x86' in iarl_data['addon_data']['operating_system']:
iarl_data['addon_data']['7za_path'] = os.path.join(iarl_data['addon_data']['addon_bin_path'],'7za','7za.x86_64')
else:
iarl_data['addon_data']['7za_path'] = None
xbmc.log(msg='IARL: 7ZA Path could not be defined', level=xbmc.LOGDEBUG)

#Define path to CHDMAN binary
if 'OSX' in iarl_data['addon_data']['operating_system']:
Expand Down
3 changes: 2 additions & 1 deletion addon.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.program.iarl" name="Internet Archive ROM Launcher" version="1.5.8" provider-name="Zach Morris">
<addon id="plugin.program.iarl" name="Internet Archive ROM Launcher" version="1.5.9" provider-name="Zach Morris">
<requires>
<import addon="xbmc.python" version="2.14.0"/>
<import addon="plugin.video.youtube" version="5.1.9"/>
<import addon="script.module.dateutil" version="2.4.2"/>
<import addon="script.module.requests" version="2.9.1"/>
<import addon="virtual.system-tools" version="7.0.100" optional="true"/>
</requires>
<extension point="xbmc.python.pluginsource" library="addon.py">
<provides>video game</provides>
Expand Down
Binary file added resources/bin/7za/7z.android
Binary file not shown.
14,671 changes: 14,671 additions & 0 deletions resources/data/dat_files/MAME_AKNF_Full.xml

Large diffs are not rendered by default.

16 changes: 14 additions & 2 deletions resources/lib/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2055,7 +2055,7 @@ def setup_mame_softlist_game(iarl_data,softlist_type):
xbmc.log(msg='IARL: Error creating MAME hash path: ' +str(current_hash_path), level=xbmc.LOGERROR)
if not os.path.isfile(save_hash_filename): #Download the hash file if it's not already present
from resources.lib.webutils import *
hash_dl_success = download_tools().Downloader(softlist_info['web_url'][0],save_hash_filename,99999,str(os.path.split(softlist_info['web_url'][0])),'Downloading hash file, please wait...')
hash_dl_success = download_tools().Downloader(softlist_info['web_url'][0],save_hash_filename,False,'','',99999,str(os.path.split(softlist_info['web_url'][0])),'Downloading hash file, please wait...') #No login required for github raw files
if not hash_dl_success:
xbmc.log(msg='IARL: Error downloading MAME hash file: ' +str(softlist_info['web_url'][0]), level=xbmc.LOGERROR)
else:
Expand Down Expand Up @@ -2597,7 +2597,7 @@ def check_file_exists_wildcard(file_path,file_name_2):
matching_files = matching_files+glob.glob(os.path.join(file_path_base,file_path_name2.replace(',','*').replace(' ','*')+'*')) #Search for the filename with a different extension or folder with same name
matching_files = matching_files+glob.glob(os.path.join(file_path_base,'*',file_path_name2.replace(',','*').replace(' ','*')+'*')) #Add recursive search one folder down for MESS type setups
matching_files = matching_files+glob.glob(os.path.join(file_path_base,clean_file_folder_name(file_path_name2.replace(',','*').split('(')[0])+'*')) #Add search for processed filenames used in IARL
remove_these_filetypes = ['srm','sav','fs'] #Save filetypes
remove_these_filetypes = ['srm','sav','fs','state','auto'] #Save filetypes
matching_files = list(set([x for x in matching_files if x.split('.')[-1].lower() not in remove_these_filetypes])) #Remove duplicates and save filetypes
if len(matching_files)>0:
file_found = True
Expand All @@ -2620,5 +2620,17 @@ def check_downloaded_file(file_path):
xbmc.log(msg='IARL: The file '+str(file_path)+' was 0 bytes in size.', level=xbmc.LOGERROR)
os.remove(file_path) #Remove Zero Byte File
bad_file_found = True
if st.st_size > 1 and st.st_size < 6000: #Small file, check if archive.org returned 'item not found'
try:
with open(file_path, 'r') as content_file:
file_contents = content_file.read().replace('\n', '')
if '<title>item not available' in file_contents.lower():
current_dialog = xbmcgui.Dialog()
ok_ret = current_dialog.ok('Error','Archive returned no file or requires login in settings.')
xbmc.log(msg='IARL: Archive.org returned a bad file for '+str(file_path)+'. The archive may require login to download this file.', level=xbmc.LOGERROR)
os.remove(file_path) #Remove bad file.
bad_file_found = True
except:
xbmc.log(msg='IARL: The file '+str(file_path)+' couldnt be read for validity.', level=xbmc.LOGDEBUG)

return bad_file_found
Binary file added resources/skins/Default/media/aknf_banner.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/skins/Default/media/aknf_boxart.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

1 comment on commit 624af8e

@zach-morris
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also added check for empty file returned from archive.org (usually happens when the user isnt logged in)

Please sign in to comment.