__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
--[[
 * Copyright © 2018 The Grilo Developers.
 *
 * Contact: Jean Felder <[email protected]>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation; version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA
 *
--]]

---------------------------
-- Source initialization --
---------------------------

source = {
  id = "grl-theaudiodb-cover",
  name = "TheAudioDB Cover",
  description = "a source for album covers and artist art",
  supported_keys = { 'thumbnail' },
  supported_media = { 'audio' },
  config_keys = {
    required = { "api-key" },
  },
  resolve_keys = {
    ["type"] = "audio",
    required = { "artist" },
    optional = { "album" },
  },
  tags = { 'music', 'net:internet' },
}

netopts = {
  user_agent = "Grilo Source TheAudioDB/0.3.8",
}

------------------
-- Source utils --
------------------
theaudiodb = {}
covers_fields = {
  album = {"strAlbumThumb", "strAlbumThumbBack", "strAlbumCDart", "strAlbumSpine"},
  artists = {"strArtistThumb", "strArtistClearart", "strArtistFanart", "strArtistFanart2", "strArtistFanart3"}
}

THEAUDIODB_ROOT_URL = "https://theaudiodb.com/api/v1/json/%s/"
THEAUDIODB_SEARCH_ALBUM = THEAUDIODB_ROOT_URL .. "searchalbum.php?s=%s&a=%s"
THEAUDIODB_SEARCH_ARTIST = THEAUDIODB_ROOT_URL .. "search.php?s=%s"

---------------------------------
-- Handlers of Grilo functions --
---------------------------------

function grl_source_init (configs)
  theaudiodb.api_key = configs.api_key
  return true
end

-- Resolve operation is able to download artist arts or album cover arts.
-- To download an album cover art, both artist and album keys have to be set.
-- To download an artist art, only the artist key has to be set.
function grl_source_resolve()
  local url, keys
  local artist, album
  local search_type

  keys = grl.get_media_keys()

  if not keys.artist or #keys.artist == 0 then
    grl.callback()
    return
  end

  -- Prepare artist and optional album strings to the url
  artist = grl.encode(keys.artist)
  if keys.album and  #keys.album > 0 then
    search_type = "album"
    album = grl.encode(keys.album)
    url = string.format(THEAUDIODB_SEARCH_ALBUM, theaudiodb.api_key, artist, album)
  else
    search_type = "artists"
    url = string.format(THEAUDIODB_SEARCH_ARTIST, theaudiodb.api_key, artist)
  end

  grl.fetch(url, netopts, fetch_cb, search_type)
end

---------------
-- Utilities --
---------------

function fetch_cb(result, search_type)
  local json = {}

  if not result then
    grl.callback()
    return
  end

  json = grl.lua.json.string_to_table(result)
  if not json or not json[search_type] or #json[search_type] == 0 then
    grl.callback()
    return
  end

  local media = {}
  local thumb = {}
  for _, val in ipairs(covers_fields[search_type]) do
    thumb[#thumb + 1] = json[search_type][1][val] or nil
  end

  media.thumbnail = thumb

  grl.callback(media)
end

Filemanager

Name Type Size Permission Actions
grl-acoustid.lua File 7.95 KB 0644
grl-guardianvideos.gresource File 4.51 KB 0644
grl-guardianvideos.lua File 4.31 KB 0644
grl-itunes-podcast.gresource File 530.2 KB 0644
grl-itunes-podcast.lua File 7.72 KB 0644
grl-lastfm-cover.lua File 2.6 KB 0644
grl-musicbrainz-coverart.lua File 2.96 KB 0644
grl-radiofrance.gresource File 8.39 KB 0644
grl-radiofrance.lua File 3.62 KB 0644
grl-steam-store.lua File 3.65 KB 0644
grl-theaudiodb-cover.lua File 3.4 KB 0644
grl-thegamesdb.lua File 8.97 KB 0644
grl-video-title-parsing.lua File 4.27 KB 0644
Filemanager