commit c70ca839e674cd822cc99ebf069decb70cd97bd8 Author: bassdart Date: Wed Nov 14 16:52:19 2018 +0100 initial import to git diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..03b0f8f --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,281 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS +------------------------------------------------------------------------- diff --git a/addon.xml b/addon.xml new file mode 100644 index 0000000..516779b --- /dev/null +++ b/addon.xml @@ -0,0 +1,35 @@ + + + + + + + + + + audio video + + + assorted collection of mostly electronic music videos + Addon for https://vidfltr.slashproc.org + A few videos don't work in every country + assorted collection of mostly electronic music videos + Addon für https://vidfltr.slashproc.org + Ein Paar Videos funktionieren nicht in allen Ländern + + all + GNU GENERAL PUBLIC LICENSE. Version 2, June 1991 + + https://vidfltr.slashproc.org/ + + https://kodi.slashproc.org/repo/plugin.video.vidfltr/ + 0.9.3 +- Minor cleanups +0.9.2 +- New: "More from..." artist context menu +- New: "Similar Music" context menu (generated with Musly) +0.9.1 +- Inital Release + + + diff --git a/changelog.txt b/changelog.txt new file mode 100644 index 0000000..485c31c --- /dev/null +++ b/changelog.txt @@ -0,0 +1,7 @@ +0.9.3 +- Minor cleanups +0.9.2 +- New: "More from..." artist context menu +- New: "Similar Music" context menu (generated with Musly) +0.9.1 +- Inital Release diff --git a/default.py b/default.py new file mode 100644 index 0000000..2153554 --- /dev/null +++ b/default.py @@ -0,0 +1,1038 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals +from kodi_six import xbmc, xbmcaddon, xbmcgui, xbmcplugin +import sys +import os +import urllib +import json +import io +import re +import time +from datetime import date, datetime, timedelta +import random +from unidecode import unidecode + +addonID = 'plugin.video.vidfltr' +addon = xbmcaddon.Addon(id=addonID) +pluginhandle = int(sys.argv[1]) +translation = addon.getLocalizedString +addonDir = xbmc.translatePath(addon.getAddonInfo('path')) +defaultFanart = os.path.join(addonDir, 'resources/images/noicon.png') +fanart = os.path.join(addonDir, 'noicon.png') +icon = os.path.join(addonDir, 'noicon.png') +addon_work_folder = xbmc.translatePath("special://profile/addon_data/" + addonID) +jsonVideos = xbmc.translatePath("special://profile/addon_data/" + addonID + "/videos.json") +jsonArtists = xbmc.translatePath("special://profile/addon_data/" + addonID + "/artists.json") +jsonStyles = xbmc.translatePath("special://profile/addon_data/" + addonID + "/styles.json") +maxFileAge = int(addon.getSetting("maxFileAge")) +maxFileAge = maxFileAge * 60 +mediatype = addon.getSetting("mediatype") +# show only official, fanmade or all videos? +videoselection = str(addon.getSetting("videoselection")).lower() +# despite this selection show all in similar playlists and more from? +relatedselection = str(addon.getSetting("relatedselection")).lower() +playLocalFile = str(addon.getSetting("playLocalFile")).lower() +filesinlists = int(addon.getSetting("filesinlists")) +useYTDL = addon.getSetting("useytdl") +# show if video is unofficial in title +showunoffintitle = addon.getSetting("showunoffintitle") +# summed up provider playcount considered to be played often +pcounthigh = int(addon.getSetting("pcounthigh")) +# local playcount considered to be played often +lcounthigh = int(addon.getSetting("lcounthigh")) +# addon developer playcount considered to be often played +acounthigh = int(addon.getSetting("acounthigh")) +# summed up provider comment count considered to be high +ccounthigh = int(addon.getSetting("ccounthigh")) +# like count considered to be high +likecounthigh = int(addon.getSetting("likecounthigh")) +# dislike count considered to be high +dislikecounthigh = int(addon.getSetting("dislikecounthigh")) + +# play from here. Does work in general but refreshes the container which is bit contra-productive in random lists ;) +# XBMC.PlayMedia(plugin://plugin.video.vidfltr/?mode=sortTitlesBy&url=year%7crandom%7c-1,isdir) + +if not os.path.isdir(addon_work_folder): + os.mkdir(addon_work_folder) + +def getVideos(): + if not os.path.isfile(jsonVideos): + updateData() + else: + fileTime = os.path.getmtime(jsonVideos) + now = time.time() + if now - fileTime > maxFileAge: + updateData() + with io.open(jsonVideos, 'r', encoding='utf-8') as f: + data = json.load(f) + return data + +def getArtists(): + if not os.path.isfile(jsonArtists): + updateData() + else: + fileTime = os.path.getmtime(jsonArtists) + now = time.time() + if now - fileTime > maxFileAge: + updateData() + with io.open(jsonArtists, 'r', encoding='utf-8') as f: + data = json.load(f) + return data + +def getStyles(): + if not os.path.isfile(jsonStyles): + updateData() + else: + fileTime = os.path.getmtime(jsonStyles) + now = time.time() + if now - fileTime > maxFileAge: + updateData() + with io.open(jsonStyles, 'r', encoding='utf-8') as f: + data = json.load(f) + return data + +def updateData(): + try: + target = urllib.URLopener() + target.retrieve("https://vidfltr.slashproc.org/api/videos.json", jsonVideos) + target = urllib.URLopener() + target.retrieve("https://vidfltr.slashproc.org/api/artists.json", jsonArtists) + target = urllib.URLopener() + target.retrieve("https://vidfltr.slashproc.org/api/styles.json", jsonStyles) + except: + # return to getVideos/getArtists on network error or 404 or... + # ...to make it not fatal if the json can't be updated + return + +def alphabet(): + alphabet = ['#'] + for letter in range(65, 91): + alphabet.append(chr(letter)) + return alphabet + +def main(): + addDir(translation(30029), '', 'mainrandom', fanart) + addDir(translation(30012), '', 'mainsorted', fanart) + addDir(translation(30022), '&sort=all', 'styles', fanart) + addDir(translation(30005), '', 'artists', fanart) + addDir(translation(30118), '', 'countrycodes', fanart) + addDir(translation(30001), '', 'search', fanart) + addDir(translation(30006), '', 'updateData', fanart) + endOfDirectory() + + +def artists(): + for alpha in alphabet(): + addDir(alpha, '&style=artists&limit=' + alpha, 'showArtist', fanart) + endOfDirectory() + +def countrycodes(): + data = getArtists() + result = [] + for entry in data: + countrycode = entry['countrycode'] + if countrycode != "" and countrycode not in result: + result.append(countrycode) + elif countrycode == "" and "unknown" not in result: + result.append('unknown') + result.sort() + for entry in result: + addDir(entry, '&style=country&limit=' + entry, 'showArtist', fanart, len(result)) + endOfDirectory() + +def mainrandom(): + addDir(translation(30034), '&limit=year&sort=random&start=0', 'sortTitlesBy', fanart) + addDir(translation(30035), '&limit=year&sort=random&start=0&hit=true', 'sortTitlesBy', fanart) + addDir(translation(30017), '&limit=all&sort=random&start=0', 'sortTitlesBy', fanart) + addDir(translation(30031), '&limit=all&sort=random&start=0&hit=true', 'sortTitlesBy', fanart) + addDir(translation(30117), '&sort=random', 'numbers', fanart) + addDir(translation(30022), '&sort=random', 'styles', fanart) + endOfDirectory() + +def mainsorted(): + addDir(translation(30032), '&limit=all&sort=date&start=0', 'sortTitlesBy', fanart) + addDir(translation(30033), '&limit=all&sort=date&start=0&hit=true', 'sortTitlesBy', fanart) + addDir(translation(30117), '&sort=sorted', 'numbers', fanart) + addDir(translation(30022), '&sort=sorted', 'styles', fanart) + endOfDirectory() + +def numbers(): + if sort == "random": + addDir(translation(30111), '&limit=all&sort=random&start=0&count=pcount', 'sortTitlesBy', fanart) + addDir(translation(30113), '&limit=all&sort=random&start=0&count=acount', 'sortTitlesBy', fanart) + addDir(translation(30114), '&limit=all&sort=random&start=0&count=comments', 'sortTitlesBy', fanart) + addDir(translation(30115), '&limit=all&sort=random&start=0&count=likes', 'sortTitlesBy', fanart) + addDir(translation(30116), '&limit=all&sort=random&start=0&count=dislikes', 'sortTitlesBy', fanart) + addDir(translation(30119), '&limit=all&sort=random&start=0&count=controversial', 'sortTitlesBy', fanart) + endOfDirectory() + if sort == "sorted": + addDir(translation(30111), '&limit=all&sort=count&start=0&count=pcount', 'sortTitlesBy', fanart) + addDir(translation(30113), '&limit=all&sort=count&start=0&count=acount', 'sortTitlesBy', fanart) + addDir(translation(30114), '&limit=all&sort=count&start=0&count=comments', 'sortTitlesBy', fanart) + addDir(translation(30115), '&limit=all&sort=count&start=0&count=likes', 'sortTitlesBy', fanart) + addDir(translation(30116), '&limit=all&sort=count&start=0&count=dislikes', 'sortTitlesBy', fanart) + addDir(translation(30119), '&limit=all&sort=count&start=0&count=controversial', 'sortTitlesBy', fanart) + endOfDirectory() + + +def play(url): + data = getVideos() + result = [] + slug = url + if slug != "": + for entry in data: + if entry['slug'] == slug: + # play from local file. + # does only work on addon developer pc -- atleast for now + if playLocalFile == "true": + musicvideoid = "-1" + try: + # try to find music video in library with utc time from slug + dateadded = datetime.utcfromtimestamp(float(entry['slug'])) + dateadded = str(dateadded) + jsonRespond = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "params": {"sort": {"order": "ascending", "method": "title"}, "filter": {"operator": "contains", "field": "dateadded", "value": "%s"}, "properties": ["file", "playcount", "genre", "artist", "title"]}, "limits":{"end":0,"start":0}, "method": "VideoLibrary.GetMusicvideos", "id": "libMusicVideos"}' % dateadded) + local = json.loads(jsonRespond) + for vid in local["result"]["musicvideos"]: + playback_url = vid["file"] + musicvideoid = int(vid["musicvideoid"]) + playcount = int(vid['playcount']) + genre = vid['genre'] + artist = vid['artist'] + artist = ''.join(artist) + title = vid['title'] + title = (artist + ' - ' + title ) + xbmc.log(msg="date from slug", level=xbmc.LOGDEBUG) + + except: + try: + # if not found because of inconsistencies based on MEZ vs. MESZ try to find music video in library with time from dateadded + dateadded = entry['dateadded'] + jsonRespond = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "params": {"sort": {"order": "ascending", "method": "title"}, "filter": {"operator": "contains", "field": "dateadded", "value": "%s"}, "properties": ["file", "playcount", "genre", "artist", "title"]}, "limits":{"end":0,"start":0}, "method": "VideoLibrary.GetMusicvideos", "id": "libMusicVideos"}' % dateadded) + local = json.loads(jsonRespond) + for vid in local["result"]["musicvideos"]: + playback_url = vid["file"] + musicvideoid = int(vid["musicvideoid"]) + playcount = int(vid['playcount']) + genre = vid['genre'] + artist = vid['artist'] + artist = ''.join(artist) + title = vid['title'] + title = (artist + ' - ' + title ) + xbmc.log(msg="date from dateadded", level=xbmc.LOGDEBUG) + except: + if useYTDL == "true": + # if play from local file is set but nonetheless not found use Provider-URL + xbmc.log(msg="not found, play from provider", level=xbmc.LOGDEBUG) + import YDStreamExtractor + idVideo = entry['purl'] + ytdl = YDStreamExtractor.getVideoInfo(idVideo) + playback_url = ytdl.streamURL() + musicvideoid = "-1" + else: + # without youtube_dl + xbmc.log(msg="without ytdl", level=xbmc.LOGDEBUG) + playback_url = entry['url'] + + # default mode: play from provider -- either with ytdl or vimeo/youtube/dailymotion addon + else: + xbmc.log(msg="play from provider", level=xbmc.LOGDEBUG) + if useYTDL == "true": + xbmc.log(msg="with ytdl", level=xbmc.LOGDEBUG) + import YDStreamExtractor + idVideo = entry['purl'] + ytdl = YDStreamExtractor.getVideoInfo(idVideo) + playback_url = ytdl.streamURL() + else: + # without youtube_dl + xbmc.log(msg="without ytdl", level=xbmc.LOGDEBUG) + playback_url = entry['url'] + + item = xbmcgui.ListItem(path=playback_url) + + # avoids CCurlFile::Stat - Failed: Unsupported protocol(1) for plugin:// + # disabled, unclear if this is the way to + #item.setContentLookup(False) + + # add some Listitem info for local files + # should already be set in addVideo() but it isn't, doh! + if playLocalFile == "true" and not musicvideoid == "-1": + item.setInfo(type="video", infoLabels={"mediatype": mediatype, "dbid": musicvideoid, "title": title, "genre": genre }) + +# doesn't work +# item.setProperty('StartOffset', '56.4') +# item.setProperty("VolumeAmplification", "7") +# xbmc.log(msg=item.getProperty('VolumeAmplification'), level=xbmc.LOGNOTICE) + + xbmc.log(msg=playback_url, level=xbmc.LOGNOTICE) + xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, item) + +def styles(): + data = getVideos() + channels = [] + xbmc.log(msg=sort, level=xbmc.LOGDEBUG) + for entry in data: + if entry['style'] not in channels: + channels.append(entry['style']) + length = len(channels) + channels.sort() + for channel in channels: + addDir(channel, '&style=' + channel + '&sort=' + sort, 'showChannel', getFanart(channel), length) + endOfDirectory() + + +def showChannel(style, sort): + channel = style + if channel != "": + fanart = getFanart(channel) + xbmc.log(msg=channel, level=xbmc.LOGDEBUG) + if sort == "sorted" or sort == "all": + addDir(translation(30032), '&limit=' + channel + '&sort=date&start=0', 'sortTitlesBy', fanart, 6) + addDir(translation(30033), '&limit=' + channel + '&sort=date&start=0&hit=true', 'sortTitlesBy', fanart, 6) + # genre splitted artists, only menu entry which uses the old initials mode and + # therefore entries where the artist isn't at the beginning of the title are excluded :-( + addDir(translation(30005), channel, 'sortTitleInitials', fanart, 6) + if sort == "random" or sort == "all": + addDir(translation(30029), '&limit=' + channel + '&sort=random&start=0', 'sortTitlesBy', fanart, 6) + addDir(translation(30031), '&limit=' + channel + '&sort=random&start=0&hit=true', 'sortTitlesBy', fanart, 6) + endOfDirectory() + + +def sortTitleInitials(channel=""): + data = getVideos() + result = [] + fanart = getFanart(channel) + if channel != "": + for entry in data: + if entry['style'] == channel: + if len(entry['title']) > 0: + l = entry['title'][0].upper() + if not re.match('^([a-z|A-Z])', l): + l = '#' + if l not in result: + if videoselection == "0": + if "true" in entry['official'].lower(): + result.append(l) + elif videoselection == "1": + if "false" in entry['official'].lower(): + result.append(l) + else: + result.append(l) + result.sort() + for entry in result: + addDir(entry, channel + '|' + entry, 'sortTitles', fanart, len(result)) + endOfDirectory() + + +def sortArtistInitials(channel=""): + data = getVideos() + result = [] + fanart = getFanart(channel) + if channel != "": + for entry in data: + for artist in entry['artists']: +# xbmc.log(msg=channel.encode('utf-8'), level=xbmc.LOGNOTICE) +# xbmc.log(msg=artist.encode('utf-8'), level=xbmc.LOGNOTICE) + if artist not in channel: + if len(artist) > 0: + l = artist[0].upper() + if not re.match('^([a-z|A-Z])', l): + l = '#' + if l not in result: + if videoselection == "0": + if "true" in entry['official'].lower(): + result.append(l) + elif videoselection == "1": + if "false" in entry['official'].lower(): + result.append(l) + else: + result.append(l) + result.sort() + for entry in result: + addDir(entry, channel + '|' + entry, + 'sortArtists', fanart, len(result)) + endOfDirectory() + + +def sortTitles(channelInitial=""): + xbmcplugin.setContent(pluginhandle, 'musicvideos') + data = getVideos() + result = [] + params = channelInitial.split("|") + channel = "" + initial = "" + if len(params) > 1: + channel = params[0] + initial = params[1] +# else: +# channel = params[0] + fanart = getFanart(channel) +# xbmc.log(msg=initial.encode('utf-8'), level=xbmc.LOGNOTICE) + if channel != "": + xbmc.log(msg=channel.encode('utf-8'), level=xbmc.LOGDEBUG) + for entry in data: + if entry['style'] == channel: + i = entry['title'][0].upper() + if initial == '#': + if not re.match('^([a-z|A-Z])', i): + if videoselection == "0": + if "true" in entry['official'].lower(): + result.append(entry) + elif videoselection == "1": + if "false" in entry['official'].lower(): + result.append(entry) + else: + result.append(entry) + else: + if initial == i: + if videoselection == "0": + if "true" in entry['official'].lower(): + result.append(entry) + elif videoselection == "1": + if "false" in entry['official'].lower(): + result.append(entry) + else: + result.append(entry) + # sloooow + #elif channel in entry['artists']: + # result.append(entry) + result.sort(key=lambda entry: entry['title'].upper()) + for entry in result: + addVideo(entry) + endOfDirectory() + + +def showArtist(url): + # limit artists by first letter or country + data = getArtists() + result = [] +# xbmc.log(msg=url, level=xbmc.LOGNOTICE) +# xbmc.log(msg=style, level=xbmc.LOGNOTICE) +# xbmc.log(msg=limit, level=xbmc.LOGNOTICE) + + if style == 'artists': + for entry in data: + i = unidecode(entry['artist'])[0].upper() + if limit == '#': + if not re.match('^([a-z|A-Z])', i): + result.append(entry) + else: + if limit == i: + result.append(entry) + + elif style == 'country': + for entry in data: + i = entry['countrycode'] + if limit == i: + result.append(entry) + elif limit == 'unknown': + result.append(entry) + + for entry in result: + artist = entry['artist'] + fanart = entry['thumbnail'] + + if videoselection == "0": + if entry['official'] >= "1": + addDir(artist, unidecode(artist.upper()), 'sortArtists', fanart, len(result)) + elif videoselection == "1": + if entry['unofficial'] >= "1": + addDir(artist, unidecode(artist.upper()), 'sortArtists', fanart, len(result)) + elif videoselection == "2": + addDir(artist, unidecode(artist.upper()), 'sortArtists', fanart, len(result)) + endOfDirectory() + +def sortArtists(channel=""): + # get videos for individual artist + xbmcplugin.setContent(pluginhandle, 'musicvideos') + data = getVideos() + result = [] + # using param=string parameters does not work here because some obscure chars + # are lost in translation so the old implementation from Mediathek Direkt with + # splitting on | will be used. Have to take a deeper look to fix this... + params = channel.split("|") +# xbmc.log(msg=url, level=xbmc.LOGNOTICE) + channel = params[0] + if len(params) > 1: + start = params[1] + if channel != "" and channel != "relaartists": + fanart = getFanart(channel) + for entry in data: + artists_upper = [unidecode(artist.upper()) for artist in entry['artists']] + + if channel in artists_upper: + if videoselection == "0": + if "true" in entry['official'].lower(): + result.append(entry) + elif videoselection == "1": + if "false" in entry['official'].lower(): + result.append(entry) + else: + result.append(entry) + #show "more from..." artists + if channel != "" and channel == "relartists": + fanart = getFanart(channel) + for entry in data: + if entry['slug'] == start: + artists_upper = [unidecode(artist.upper()) for artist in entry['artists']] + channels = [] + for channel in artists_upper: + channels.append(channel) + xbmc.log(msg=str(channels), level=xbmc.LOGNOTICE) + + # nested loops don't look like an optimal solution and are a bit slow + for entry in data: + for artist in channels: + if artist in [unidecode(name.upper()) for name in entry['artists']]: + if entry not in result: + if videoselection == "0": + if "true" in entry['official'].lower(): + result.append(entry) + elif videoselection == "1": + if "false" in entry['official'].lower(): + result.append(entry) + else: + result.append(entry) + + + result.sort(key=lambda entry: entry['title'].upper()) + for entry in result: +# xbmc.log(msg=url, level=xbmc.LOGNOTICE) + addVideo(entry) + endOfDirectory() + +def sortTitlesBy(limit, sort, start): + xbmcplugin.setContent(pluginhandle, 'musicvideos') + data = getVideos() + result = [] + channel = limit + start = int(start) + end = start + filesinlists + nextstart = end + 1 +# xbmc.log(msg=channel, level=xbmc.LOGNOTICE) + + fanart = getFanart(channel) + # limit to hits + if hit != "" and hit == "true": + for entry in data: + if entry['hit'] == "true": + if videoselection == "0": + if "true" in entry['official']: + result.append(entry) + elif videoselection == "1": + if "false" in entry['official']: + result.append(entry) + elif videoselection == "2": + result.append(entry) + data = result + result = [] + # played often at provider + if mycount != "" and mycount == "pcount" and sort != "count": + for entry in data: + # played often at provider + if int(entry['pcount']) >= pcounthigh: + if videoselection == "0": + if "true" in entry['official']: + result.append(entry) + elif videoselection == "1": + if "false" in entry['official']: + result.append(entry) + elif videoselection == "2": + result.append(entry) +# xbmc.log(msg=str(entry['pcount']), level=xbmc.LOGNOTICE) + data = result + result = [] + # played often by addon developer + if mycount != "" and mycount == "acount" and sort != "count": + for entry in data: + if int(entry['acount']) >= acounthigh: + if videoselection == "0": + if "true" in entry['official']: + result.append(entry) + elif videoselection == "1": + if "false" in entry['official']: + result.append(entry) + elif videoselection == "2": + result.append(entry) +# xbmc.log(msg=str(entry['pcount']), level=xbmc.LOGNOTICE) + data = result + result = [] + + # often commented + if mycount != "" and mycount == "comments" and sort != "count": + for entry in data: + if int(entry['comments']) >= ccounthigh: + if videoselection == "0": + if "true" in entry['official']: + result.append(entry) + elif videoselection == "1": + if "false" in entry['official']: + result.append(entry) + elif videoselection == "2": + result.append(entry) +# xbmc.log(msg=str(entry['pcount']), level=xbmc.LOGNOTICE) + data = result + result = [] + + # often liked + if mycount != "" and mycount == "likes" and sort != "count": + for entry in data: + if int(entry['likes']) >= likecounthigh: + if videoselection == "0": + if "true" in entry['official']: + result.append(entry) + elif videoselection == "1": + if "false" in entry['official']: + result.append(entry) + elif videoselection == "2": + result.append(entry) +# xbmc.log(msg=str(entry['pcount']), level=xbmc.LOGNOTICE) + data = result + result = [] + + # often disliked + if mycount != "" and mycount == "dislikes" and sort != "count": + for entry in data: + if int(entry['dislikes']) >= dislikecounthigh: + if videoselection == "0": + if "true" in entry['official']: + result.append(entry) + elif videoselection == "1": + if "false" in entry['official']: + result.append(entry) + elif videoselection == "2": + result.append(entry) +# xbmc.log(msg=str(entry['pcount']), level=xbmc.LOGNOTICE) + data = result + result = [] + + # controversial based on nearly the same number of likes and dislikes + if mycount != "" and mycount == "controversial": + for entry in data: + if int(entry['controversial']) == int(1): + if videoselection == "0": + if "true" in entry['official']: + result.append(entry) + elif videoselection == "1": + if "false" in entry['official']: + result.append(entry) + elif videoselection == "2": + result.append(entry) +# xbmc.log(msg=str(entry['pcount']), level=xbmc.LOGNOTICE) + data = result + result = [] + + # limit by style + if channel != "" and channel != "all" and channel != "year" and channel != "related": + for entry in data: + if entry['style'] == channel: + if videoselection == "0": + if "true" in entry['official']: + result.append(entry) + elif videoselection == "1": + if "false" in entry['official']: + result.append(entry) + elif videoselection == "2": + result.append(entry) + # or limit to last year + # hm, either style or year, not both? + elif channel != "" and channel == "year": + lastyear = datetime.now() - timedelta(days=365) + for entry in data: +# dateadded = entry['dateadded'] + # ehrm, first version worked for many days but now fails? + # related to https://bugs.python.org/issue27400 ? + try: + dateadded = datetime.strptime(entry['dateadded'], '%Y-%m-%d %H:%M:%S') + except TypeError: + import time + dateadded = datetime.fromtimestamp(time.mktime(time.strptime(entry['dateadded'], '%Y-%m-%d %H:%M:%S'))) + if dateadded >= lastyear: + if videoselection == "0": + if "true" in entry['official']: + result.append(entry) + elif videoselection == "1": + if "false" in entry['official']: + result.append(entry) + elif videoselection == "2": + result.append(entry) + # related tracks (generated with musly) + elif channel != "" and channel == "related": + start = str(start) +# xbmc.log(msg=str(start), level=xbmc.LOGNOTICE) + for entry in data: + if entry['slug'] == start: + # add slug for which the playlist should be shown + result.append(entry) + slugs = "" + slugs = entry['related'] +# xbmc.log(msg=slugs, level=xbmc.LOGNOTICE) + for entry in data: + # add all related slugs + if entry['slug'] in slugs: +# xbmc.log(msg=str(entry), level=xbmc.LOGNOTICE) + # hm, doesn't work + if entry['artist'] not in result: + if videoselection != "2" and relatedselection != "true": + if videoselection == "0": + if "true" in entry['official']: + result.append(entry) + elif videoselection == "1": + if "false" in entry['official']: + result.append(entry) + else: + result.append(entry) + + maximum = len(result) + start = 0 + + # "more from..." artists + elif channel != "" and channel == "relartists": + start = str(start) + for entry in data: + if entry['slug'] == start: + # add slug for which the artists should be shown + artists = "" + artists = entry['artists'] + for entry in data: + xbmc.log(msg=str(artists), level=xbmc.LOGNOTICE) + # add all entries with artist in artists + if entry['artists'] in artists: +# xbmc.log(msg=str(entry), level=xbmc.LOGNOTICE) + if videoselection != "2" and relatedselection != "true": + if videoselection == "0": + if "true" in entry['official']: + result.append(entry) + elif videoselection == "1": + if "false" in entry['official']: + result.append(entry) + else: + result.append(entry) + maximum = len(result) + start = 0 + + # not used anywhere? + else: + for entry in data: + if videoselection == "0": + if "true" in entry['official']: + result.append(entry) + elif videoselection == "1": + if "false" in entry['official']: + result.append(entry) + elif videoselection == "2": + result.append(entry) + + if sort != "" and sort == "random": + random.shuffle(result) + result = result[:filesinlists] + start = 0 + end = filesinlists + maximum = filesinlists - 1 + if sort != "" and sort == "date": + if channel != "": + modus = channel + else: + modus = 'all' + result = result + maximum = len(result) + if sort != "" and sort == "count": + if channel != "": + modus = channel + else: + modus = 'all' + # sort by negated count first and then by title in lexical order. + # If count would'nt be negated one had to use reverse=true + # But then the second sorting, by title would be reversed also + result = sorted(result, key = lambda i: (-1*float(i[mycount]), i['title'])) + # itemgetter, should be faster (hm, but does'nt work: ValueError: could not convert string to float: pcount) + # importing "operator" for implementing itemgetter + #from operator import itemgetter + #result = sorted(result, key=itemgetter((float(mycount), 'title'),reverse = True)) + + maximum = len(result) + else: + maximum = len(result) +# play all (TODO) + addDir(translation(30109), '', '', fanart) +# back to VIDFLTR (only useful if the back history would be cleared) +# if start > 0: +# addDir(translation(30108), '', 'main', fanart) + for entry in result[start:end]: + addVideo(entry, mycount) + if maximum > end and sort != "random" and channel != "year": + # next page link + if sort != "" and sort == "count": + addDir(translation(30036), '&limit=' + modus + '&sort=count&start=' + str(nextstart) + '&count=' + mycount, 'sortTitlesBy', fanart) + else: + addDir(translation(30036), '&limit=' + modus + '&sort=date&start=' + str(nextstart), 'sortTitlesBy', fanart) + endOfDirectory() + + +def endOfDirectory(): +# xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_UNSORTED) +# xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_LABEL) +# xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_DATEADDED) +# xbmcplugin.addSortMethod( +# pluginhandle, xbmcplugin.SORT_METHOD_PROGRAM_COUNT) +# xbmcplugin.addSortMethod( +# pluginhandle, xbmcplugin.SORT_METHOD_VIDEO_RUNTIME) +# xbmcplugin.addSortMethod(pluginhandle, xbmcplugin.SORT_METHOD_GENRE) + xbmcplugin.endOfDirectory(pluginhandle) + +def search(channel=""): + xbmcplugin.setContent(pluginhandle, 'musicvideos') + result = [] + keyboard = xbmc.Keyboard('', translation(30002)) + keyboard.doModal() + if keyboard.isConfirmed() and keyboard.getText(): + # search_string = keyboard.getText().encode('utf8').lower() + search_string = keyboard.getText().lower() + if len(search_string) > 1: + data = getVideos() + for entry in data: + cEntry = entry + if search_string in cEntry['title'].lower(): + if channel != "": + if cEntry['style'] == channel: + # cEntry['title'] = cEntry['style']+': + # '+cEntry['title'] + if videoselection == "0": + if "true" in entry['official'].lower(): + result.append(cEntry) + else: + result.append(cEntry) + else: + # cEntry['title'] = cEntry['style']+': + # '+cEntry['title'] + if videoselection == "0": + if "true" in entry['official'].lower(): + result.append(cEntry) + else: + result.append(cEntry) + elif search_string in cEntry['artist'].lower(): + if channel != "": + if cEntry['style'] == channel: + # cEntry['title'] = cEntry['style']+': + # '+cEntry['title'] + if videoselection == "0": + if "true" in entry['official'].lower(): + result.append(cEntry) + else: + result.append(cEntry) + else: + # cEntry['title'] = cEntry['style']+': + # '+cEntry['title'] + if videoselection == "0": + if "true" in entry['official'].lower(): + result.append(cEntry) + else: + result.append(cEntry) + + + result.sort(key=lambda entry: entry['style'].lower()) + for entry in result: + addVideo(entry) + endOfDirectory() + +# not used (TODO?) +def searchDate(channelDate=""): + xbmcplugin.setContent(pluginhandle, 'musicvideos') + channel = "" + date = "" + params = channelDate.split('|') + channel = params[0] + if len(params) > 1: + date = params[1] + result = [] + if date == "": + dialog = xbmcgui.Dialog() + date = dialog.numeric(1, translation(30007)) + date = re.sub('[^0-9|^\/]', '0', date) + date = date.replace('/', '.') + if (channel != "") and (len(date) == 10): + data = getVideos() + for entry in data: + cEntry = entry + if (entry['style'] == channel) and (entry['date'] == date): + cEntry[1] = cEntry[2] + ': ' + cEntry[1] + if videoselection == "0": + if "true" in entry['official'].lower(): + result.append(cEntry) + else: + result.append(cEntry) + result.sort(key=lambda entry: entry['title'].lower()) + for entry in result: + addVideo(entry) + endOfDirectory() + +# not used (TODO?) +def downloadFile(video_url): + # get best qualiy url + bq_url = getBestQuality(video_url) + # get filname from video_url + filename = video_url.split('/')[-1] + filetype = filename.split('.')[-1] + # open browser dialog to choose destination + dialog = xbmcgui.Dialog() + download_dir = dialog.browse(3, translation(30102), "files") + target = urllib.URLopener() + fullPath = xbmc.translatePath(download_dir + filename) + target.retrieve(video_url, fullPath) + dialog.ok(addonID, translation(30101), str(fullPath)) + +# only used in style directories +def getFanart(channel): + fanart = os.path.join( + addonDir, 'resources/images/fanart_' + channel + '.jpg') + if not os.path.isfile(fanart.encode('utf-8')): + fanart = icon + return fanart + + +def addDir(name, url, mode, iconimage, total=0): + u = sys.argv[0] + "?url=" + urllib.quote_plus(url.encode('utf-8')) + "&mode=" + str(mode) +# xbmc.log(msg=u, level=xbmc.LOGNOTICE) + ok = True + liz = xbmcgui.ListItem(name, iconImage=icon, thumbnailImage=iconimage, offscreen=True) + description = "" + if mode == "showChannel": + data = getStyles() + for style in data: + if style['style'] == name: + description = style['description'] + + liz.setInfo(type="Video", infoLabels={"Title": name, "PlotOutline": description, "Plot": description, "Tagline": description}) + if iconimage: + liz.setProperty("fanart_image", iconimage) + else: + liz.setProperty("fanart_image", defaultFanart) + ok = xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=u, listitem=liz, totalItems=total, isFolder=True) + return ok + + +def addVideo(entry, mycount="playcount"): + ok = True + # Altlast. Sinn dahinter? + if len(entry) > 7: + dateadded = datetime.utcfromtimestamp(float(entry['slug'])) + dateadded = str(dateadded) + slug = entry['slug'] + url = '%s?mode=play&url=%s' % (sys.argv[0], slug) + channel = entry['artist'] + artist = entry['artist'] + artists = entry['artists'] + director = entry['director'] + title = entry['title'] + if "false" in entry['official'].lower() and "true" in showunoffintitle: + title = (title + ' (vid by ' + director + ')') + tracktitle = entry['tracktitle'] + style = entry['style'] + if mycount == "pcount": + playcount = entry['pcount'] + elif mycount == "lcount": + playcount = entry['lcount'] + else: + playcount = entry['acount'] + #slug = entry['slug'] + if playLocalFile == "true": + description = "Provider: " + entry['provider'] + "\nprovider playcount: " + entry['pcount'] + "\nlikes: " + entry['likes'] + "\ndislikes: " + entry['dislikes'] + "\ncomments: " + entry['comments'] + else: + description = "" + if "false" in entry['official'].lower(): + description = ( + "Unofficial Video by " + director + "\n" + description) + #link = entry['slug'] + fanart = entry['thumbnail'] + duration = entry['duration'] + # Soll man das nun nutzen oder nicht? + # Mit offscreen=true werden Listen zigmal schneller dargestellt (klappt erst ab krypton) + li = xbmcgui.ListItem(title, offscreen=True) + + li.setInfo(type="video", infoLabels={ "mediatype": mediatype, "Title": title, "Originaltitle": tracktitle, "Genre": style, "Director": director, "PlotOutline": description, "Plot": description, "Tagline": style, "Artist": entry['artists'], "dateadded": dateadded, "playcount": playcount, "Duration": duration}) + li.setArt({'thumb': fanart}) + li.setProperty("fanart_image", fanart) + + li.setProperty('IsPlayable', 'true') + + li.addContextMenuItems([ + (translation(30121),'XBMC.Container.Update(plugin://'+addonID+'/?mode=sortTitlesBy&url=%26start%3d'+slug+'%26limit%3drelated%26sort%3dnone)',), + (translation(30122),'XBMC.Container.Update(plugin://'+addonID+'/?mode=sortArtists&url=relartists%7C'+slug+')',) + ],replaceItems=True) + ok = xbmcplugin.addDirectoryItem(handle=pluginhandle, url=url, listitem=li) + + return ok + +def parameters_string_to_dict(parameters): + paramDict = {} + if parameters: + paramPairs = parameters[1:].split("&") + for paramsPair in paramPairs: + paramSplits = paramsPair.split('=') + if (len(paramSplits)) == 2: + paramDict[paramSplits[0]] = paramSplits[1] + return paramDict + +params = parameters_string_to_dict(sys.argv[2]) +mode = urllib.unquote_plus(params.get('mode', '')).decode('utf-8') +url = urllib.unquote_plus(params.get('url', '')).decode('utf-8') + +extraparams = parameters_string_to_dict(url) +limit = urllib.unquote_plus(extraparams.get('limit', '')).decode('utf-8') +sort = urllib.unquote_plus(extraparams.get('sort', '')).decode('utf-8') +start = urllib.unquote_plus(extraparams.get('start', '')).decode('utf-8') +start = str(start) +style = urllib.unquote_plus(extraparams.get('style', '')).decode('utf-8') +hit = urllib.unquote_plus(extraparams.get('hit', '')).decode('utf-8') +mycount = urllib.unquote_plus(extraparams.get('count', '')).decode('utf-8') +slug = urllib.unquote_plus(extraparams.get('slug', '')).decode('utf-8') + +#xbmc.log(msg=str(sys.argv), level=xbmc.LOGNOTICE) +#xbmc.log(msg=str(mode), level=xbmc.LOGNOTICE) +#xbmc.log(msg=str(url), level=xbmc.LOGNOTICE) +#xbmc.log(msg=str(limit), level=xbmc.LOGDEBUG) +#xbmc.log(msg=str(sort), level=xbmc.LOGDEBUG) +#xbmc.log(msg=str(start), level=xbmc.LOGDEBUG) +#xbmc.log(msg=str(style), level=xbmc.LOGNOTICE) + +if mode == 'updateData': + updateData() +elif mode == 'alphabet': + alphabet() +elif mode == 'showChannel': + showChannel(style, sort) +elif mode == 'search': + search(url) +elif mode == 'sortTitleInitials': + sortTitleInitials(url) +elif mode == 'sortTitles': + sortTitles(url) +elif mode == 'sortArtists': + sortArtists(url) +elif mode == 'showArtist': + showArtist(url) +elif mode == 'sortTitlesBy': + sortTitlesBy(limit, sort, start) +elif mode == 'searchDate': + searchDate(url) +elif mode == 'mainsorted': + mainsorted() +elif mode == 'mainrandom': + mainrandom() +elif mode == 'numbers': + numbers() +elif mode == 'countrycodes': + countrycodes() +elif mode == 'artists': + artists() +elif mode == 'styles': + styles() +elif mode == 'stylesrandom': + stylesrandom() +elif mode == 'channelsrandom': + channelsrandom(url) +elif mode == 'related': + related(limit) +elif mode == 'play': + play(url) +else: + main() diff --git a/icon.png b/icon.png new file mode 100644 index 0000000..b088ad4 Binary files /dev/null and b/icon.png differ diff --git a/resources/images/fanart_Ambient.jpg b/resources/images/fanart_Ambient.jpg new file mode 100644 index 0000000..c2cf1de Binary files /dev/null and b/resources/images/fanart_Ambient.jpg differ diff --git a/resources/images/fanart_Breaks.jpg b/resources/images/fanart_Breaks.jpg new file mode 100644 index 0000000..a30725e Binary files /dev/null and b/resources/images/fanart_Breaks.jpg differ diff --git a/resources/images/fanart_Classic.jpg b/resources/images/fanart_Classic.jpg new file mode 100644 index 0000000..93ccef2 Binary files /dev/null and b/resources/images/fanart_Classic.jpg differ diff --git a/resources/images/fanart_Dubby.jpg b/resources/images/fanart_Dubby.jpg new file mode 100644 index 0000000..650484c Binary files /dev/null and b/resources/images/fanart_Dubby.jpg differ diff --git a/resources/images/fanart_Funky.jpg b/resources/images/fanart_Funky.jpg new file mode 100644 index 0000000..cb5923b Binary files /dev/null and b/resources/images/fanart_Funky.jpg differ diff --git a/resources/images/fanart_Glitch.jpg b/resources/images/fanart_Glitch.jpg new file mode 100644 index 0000000..5304899 Binary files /dev/null and b/resources/images/fanart_Glitch.jpg differ diff --git a/resources/images/fanart_Hardcore.jpg b/resources/images/fanart_Hardcore.jpg new file mode 100644 index 0000000..4607e6f Binary files /dev/null and b/resources/images/fanart_Hardcore.jpg differ diff --git a/resources/images/fanart_Hip-Hop.jpg b/resources/images/fanart_Hip-Hop.jpg new file mode 100644 index 0000000..ad69ca0 Binary files /dev/null and b/resources/images/fanart_Hip-Hop.jpg differ diff --git a/resources/images/fanart_Housy.jpg b/resources/images/fanart_Housy.jpg new file mode 100644 index 0000000..b517aa0 Binary files /dev/null and b/resources/images/fanart_Housy.jpg differ diff --git a/resources/images/fanart_Jazz.jpg b/resources/images/fanart_Jazz.jpg new file mode 100644 index 0000000..a5d78a5 Binary files /dev/null and b/resources/images/fanart_Jazz.jpg differ diff --git a/resources/images/fanart_Obscure.jpg b/resources/images/fanart_Obscure.jpg new file mode 100644 index 0000000..0e22048 Binary files /dev/null and b/resources/images/fanart_Obscure.jpg differ diff --git a/resources/images/fanart_Rock.jpg b/resources/images/fanart_Rock.jpg new file mode 100644 index 0000000..771a9f5 Binary files /dev/null and b/resources/images/fanart_Rock.jpg differ diff --git a/resources/images/fanart_Soul.jpg b/resources/images/fanart_Soul.jpg new file mode 100644 index 0000000..28dcade Binary files /dev/null and b/resources/images/fanart_Soul.jpg differ diff --git a/resources/images/fanart_Swinged.jpg b/resources/images/fanart_Swinged.jpg new file mode 100644 index 0000000..cd4562f Binary files /dev/null and b/resources/images/fanart_Swinged.jpg differ diff --git a/resources/images/fanart_Trance.jpg b/resources/images/fanart_Trance.jpg new file mode 100644 index 0000000..642ee7e Binary files /dev/null and b/resources/images/fanart_Trance.jpg differ diff --git a/resources/images/fanart_Witch House.jpg b/resources/images/fanart_Witch House.jpg new file mode 100644 index 0000000..aa0ee3e Binary files /dev/null and b/resources/images/fanart_Witch House.jpg differ diff --git a/resources/language/resource.language.de_de/strings.po b/resources/language/resource.language.de_de/strings.po new file mode 100644 index 0000000..2a930ad --- /dev/null +++ b/resources/language/resource.language.de_de/strings.po @@ -0,0 +1,241 @@ +# Kodi Media Center language file +# Addon Name: VIDFLTR Musicvideos +# Addon id: plugin.video.vidfltr +# Addon Provider: bassdart +msgid "" +msgstr "" +"Project-Id-Version: XBMC-Addons\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-11-07 16:01+0000\n" +"PO-Revision-Date: 2018-11-07 16:01+0000\n" +"Last-Translator: bassdart\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: de_DE\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgctxt "#30001" +msgid "Global Search" +msgstr "Globale Suche" + +msgctxt "#30002" +msgid "Search" +msgstr "Suche" + +msgctxt "#30003" +msgid "By Date" +msgstr "Nach Datum" + +msgctxt "#30005" +msgid "Artist A-Z" +msgstr "Künstler A-Z" + +msgctxt "#30006" +msgid "Refresh Data" +msgstr "Daten aktualisieren" + +msgctxt "#30011" +msgid "Random" +msgstr "Zufällig" + +msgctxt "#30012" +msgid "Sorted" +msgstr "Sortiert" + +msgctxt "#30013" +msgid "Last 6 Months" +msgstr "Letzte 6 Monate" + +msgctxt "#30014" +msgid "Last Year" +msgstr "Letztes Jahr" + +msgctxt "#30015" +msgid "Hits" +msgstr "Hits" + +msgctxt "#30016" +msgid "All Hits" +msgstr "Alle Hits" + +msgctxt "#30017" +msgid "Alltime" +msgstr "Allzeit" + +msgctxt "#30018" +msgid "Played often" +msgstr "Oft gespielt" + +msgctxt "#30019" +msgid "Played: Never" +msgstr "Nie gespielt" + +msgctxt "#30020" +msgid "Played: Often, No Hits" +msgstr "Oft gespielt, keine Hits" + +msgctxt "#30021" +msgid "Hits, grouped by style" +msgstr "Hits, gruppiert nach Musikstil" + +msgctxt "#30022" +msgid "Style (not genre)" +msgstr "Stil (nicht Genre)" + +msgctxt "#30025" +msgid "Artists" +msgstr "Künstler" + +msgctxt "#30026" +msgid "Official Videos" +msgstr "Offizielle Videos" + +msgctxt "#30027" +msgid "Fanmade Videos" +msgstr "Fanmade Videos" + +msgctxt "#30028" +msgid "All" +msgstr "Alle" + +msgctxt "#30029" +msgid "Random" +msgstr "Zufällig" + +msgctxt "#30030" +msgid "Files per page" +msgstr "Dateien pro Seite" + +msgctxt "#30031" +msgid "Alltime Hits" +msgstr "Allzeit Hits" + +msgctxt "#30032" +msgid "Sorted by date" +msgstr "Nach Datum sortiert" + +msgctxt "#30033" +msgid "Hits sorted by date" +msgstr "Hits nach Datum sortiert" + +msgctxt "#30034" +msgid "Last Year" +msgstr "Letztes Jahr" + +msgctxt "#30035" +msgid "Last Year Hits" +msgstr "Letztes Jahr Hits" + +msgctxt "#30036" +msgid "Next Page" +msgstr "Nächste Seite" + +msgctxt "#30097" +msgid "Standard" +msgstr "Standard" + +msgctxt "#30098" +msgid "Data refresh interval in minutes" +msgstr "Daten-Aktualisierungs-Interval in Minuten" + +msgctxt "#30099" +msgid "Show Topics directly" +msgstr "Direkt alle Themen anzeigen" + +msgctxt "#30100" +msgid "Download" +msgstr "Herunterladen" + +msgctxt "#30101" +msgid "Saved as:" +msgstr "Gespeichert als:" + +msgctxt "#30102" +msgid "Choose Destination Folder" +msgstr "Zielordner wählen" + +msgctxt "#30103" +msgid "Video Selection" +msgstr "Videoauswahl" + +msgctxt "#30104" +msgid "Play local file if available" +msgstr "Lokale Datei abspielen wenn vorhanden" + +msgctxt "#30105" +msgid "Use youtube-dl Control Addon (slower)" +msgstr "Nutze youtube-dl Control Addon (langsamer)" + +msgctxt "#30106" +msgid "Mediatype (maybe useful for skins without proper musicvideo support)" +msgstr "Mediatype (eventuell nützlich bei Skins ohne guter Musikvideo-Unterstützung)" + +msgctxt "#30107" +msgid "Only useful on the addon developer's machine (TODO)" +msgstr "Nur auf dem Rechner des Addon-Entwicklers sinnvoll (TODO)" + +msgctxt "#30108" +msgid "Back to VIDFLTR" +msgstr "Zurück zu VIDFLTR" + +msgctxt "#30109" +msgid "Play all (TODO)" +msgstr "Alle abspielen (TODO)" + +msgctxt "#30110" +msgid "Extended" +msgstr "Erweitert" + +msgctxt "#30111" +msgid "Played often (provider, combined)" +msgstr "Oft gespielt (Provider, summiert)" + +msgctxt "#30112" +msgid "Played often (local) (TODO)" +msgstr "Oft gespielt (lokal) (TODO)" + +msgctxt "#30113" +msgid "Played often (addon developer)" +msgstr "Oft gespielt (Addon-Entwickler)" + +msgctxt "#30114" +msgid "Often commented" +msgstr "Oft kommentiert" + +msgctxt "#30115" +msgid "Often liked" +msgstr "Oft geliked" + +msgctxt "#30116" +msgid "Often disliked" +msgstr "Oft disliked" + +msgctxt "#30117" +msgid "By numbers" +msgstr "Nach Zahlen" + +msgctxt "#30118" +msgid "Countrys" +msgstr "Länder" + +msgctxt "#30119" +msgid "Controversial (similar number of likes/dislikes)" +msgstr "Kontrovers (ähnlich viele likes/dislikes)" + +msgctxt "#30120" +msgid "Show in title that video is unofficial" +msgstr "Im Titel anzeigen das Video inoffiziell ist" + +msgctxt "#30121" +msgid "Similar music" +msgstr "Ähnliche Musik" + +msgctxt "#30122" +msgid "More from..." +msgstr "Mehr von..." + +msgctxt "#30123" +msgid "Show all videos in similiar and more from... playlists" +msgstr "Zeige alle Videos in Similar- und "Mehr von"-Playlisten" diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po new file mode 100644 index 0000000..ec5d7a7 --- /dev/null +++ b/resources/language/resource.language.en_gb/strings.po @@ -0,0 +1,241 @@ +# Kodi Media Center language file +# Addon Name: VIDFLTR Musicvideos +# Addon id: plugin.video.vidfltr +# Addon Provider: bassdart +msgid "" +msgstr "" +"Project-Id-Version: XBMC-Addons\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-11-07 16:01+0000\n" +"PO-Revision-Date: 2018-11-07 16:01+0000\n" +"Last-Translator: bassdart\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: en_GB\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgctxt "#30001" +msgid "Global Search" +msgstr "" + +msgctxt "#30002" +msgid "Search" +msgstr "" + +msgctxt "#30003" +msgid "By Date" +msgstr "" + +msgctxt "#30005" +msgid "Artist A-Z" +msgstr "" + +msgctxt "#30006" +msgid "Refresh Data" +msgstr "" + +msgctxt "#30011" +msgid "Random" +msgstr "" + +msgctxt "#30012" +msgid "Sorted" +msgstr "" + +msgctxt "#30013" +msgid "Last 6 Months" +msgstr "" + +msgctxt "#30014" +msgid "Last Year" +msgstr "" + +msgctxt "#30015" +msgid "Hits" +msgstr "" + +msgctxt "#30016" +msgid "All Hits" +msgstr "" + +msgctxt "#30017" +msgid "Alltime" +msgstr "" + +msgctxt "#30018" +msgid "Played often" +msgstr "" + +msgctxt "#30019" +msgid "Played: Never" +msgstr "" + +msgctxt "#30020" +msgid "Played: Often, No Hits" +msgstr "" + +msgctxt "#30021" +msgid "Hits, grouped by style" +msgstr "" + +msgctxt "#30022" +msgid "Style (not genre)" +msgstr "" + +msgctxt "#30025" +msgid "Artists" +msgstr "" + +msgctxt "#30026" +msgid "Official Videos" +msgstr "" + +msgctxt "#30027" +msgid "Fanmade Videos" +msgstr "" + +msgctxt "#30028" +msgid "All" +msgstr "" + +msgctxt "#30029" +msgid "Random" +msgstr "" + +msgctxt "#30030" +msgid "Files per page" +msgstr "" + +msgctxt "#30031" +msgid "Alltime Hits" +msgstr "" + +msgctxt "#30032" +msgid "Sorted by date" +msgstr "" + +msgctxt "#30033" +msgid "Hits sorted by date" +msgstr "" + +msgctxt "#30034" +msgid "Last Year" +msgstr "" + +msgctxt "#30035" +msgid "Last Year Hits" +msgstr "" + +msgctxt "#30036" +msgid "Next Page" +msgstr "" + +msgctxt "#30097" +msgid "Standard" +msgstr "" + +msgctxt "#30098" +msgid "Data refresh interval in minutes" +msgstr "" + +msgctxt "#30099" +msgid "Show Topics directly" +msgstr "" + +msgctxt "#30100" +msgid "Download" +msgstr "" + +msgctxt "#30101" +msgid "Saved as:" +msgstr "" + +msgctxt "#30102" +msgid "Choose Destination Folder" +msgstr "" + +msgctxt "#30103" +msgid "Video Selection" +msgstr "" + +msgctxt "#30104" +msgid "Play local file if available" +msgstr "" + +msgctxt "#30105" +msgid "Use youtube-dl Control Addon (slower)" +msgstr "" + +msgctxt "#30106" +msgid "Mediatype (maybe useful for skins without proper musicvideo support)" +msgstr "" + +msgctxt "#30107" +msgid "Only useful on the addon developer's machine (TODO)" +msgstr "" + +msgctxt "#30108" +msgid "Back to VIDFLTR" +msgstr "" + +msgctxt "#30109" +msgid "Play all (TODO)" +msgstr "" + +msgctxt "#30110" +msgid "Extended" +msgstr "" + +msgctxt "#30111" +msgid "Played often (provider, combined)" +msgstr "" + +msgctxt "#30112" +msgid "Played often (local) (TODO)" +msgstr "" + +msgctxt "#30113" +msgid "Played often (addon developer)" +msgstr "" + +msgctxt "#30114" +msgid "Often commented" +msgstr "" + +msgctxt "#30115" +msgid "Often liked" +msgstr "" + +msgctxt "#30116" +msgid "Often disliked" +msgstr "" + +msgctxt "#30117" +msgid "By numbers" +msgstr "" + +msgctxt "#30118" +msgid "Countrys" +msgstr "" + +msgctxt "#30119" +msgid "Controversial (similar number of likes/dislikes)" +msgstr "" + +msgctxt "#30120" +msgid "Show in title that video is unofficial" +msgstr "" + +msgctxt "#30121" +msgid "Similar music" +msgstr "" + +msgctxt "#30122" +msgid "More from..." +msgstr "" + +msgctxt "#30123" +msgid "Show all videos in similiar and more from... playlists" +msgstr "" diff --git a/resources/settings.xml b/resources/settings.xml new file mode 100644 index 0000000..022c75c --- /dev/null +++ b/resources/settings.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + +