Git Product home page Git Product logo

Comments (16)

alashow avatar alashow commented on June 10, 2024

Does the downloading work? If yes, it must be storage linking :

ln -s /full/path/to_root/storage/app/public/mp3 public/mp3

If not, that would be weird, because searching shouldn't work neither (meaning routing doesn't work).

And please, issues like this are not related to datmusic but datmusic-api, so open issues there.

from datmusic.

tomriddle54 avatar tomriddle54 commented on June 10, 2024

Sorry Next time i will issues datmusic-api but i am not able to download also

from datmusic.

alashow avatar alashow commented on June 10, 2024

Where did you install datmusic-api? What did you set in app.js as the endpoint?

from datmusic.

tomriddle54 avatar tomriddle54 commented on June 10, 2024

**I installed datmusic-api in mtstudio/datmusic and in mtstudio i installed datmusic **

This is the app.js

`$(document).ready(function(e) {
function a(a, o, t, i, r, d) {
0 == o && (p.currentTrack = -1, a.length > 1 && a != p.oldQuery && (window.history.pushState(a, e("title").html(), "?q=" + a), document.title = a.split(" -")[0] + " - " + p.title), p.oldQuery = a, p.page = 0), p.page = o;
var s = {
q: a,
page: o
};
e.ajax({
url: p.apiUrl + "search",
data: s,
method: "GET",
dataType: "json",
cache: !0,
beforeSend: function() {
0 == o ? e("#loading").show() : (e("#load-more").show(), e("#load-more").find(".spinner").show(), e("#load-more").find("span").hide())
},
error: function() {
l(i18n.t("networkError"))
},
success: function(t) {
if (0 == t.data) return void(0 == o ? l(i18n.t("notFound")) : e("#load-more").hide());
0 == o && e("#result > .list-group").html("");
for (var i = 0; i < t.data.length; i++) downloadUrl = t.data[i].download, streamUrl = t.data[i].stream, audioTitle = t.data[i].artist + " - " + t.data[i].title, audioDuration = t.data[i].duration.toTime(), audioView = {
clickToPlay: i18n.t("clickToPlay"),
clickToDownload: i18n.t("clickToDownload"),
durationSeconds: t.data[i].duration,
duration: audioDuration,
url: {
stream: streamUrl,
download: {
original: downloadUrl,
64: downloadUrl + "/64",
128: downloadUrl + "/128",
192: downloadUrl + "/192"
}
},
audio: audioTitle
}, audioRendered = Mustache.render(g, audioView), e("#result > .list-group").append(audioRendered);
u("search", a), e("#loading").hide(), e("#load-more").show(), e("#load-more").find("span").show(), e("#load-more").find(".spinner").hide(), n()
}
})
}

function n() {
    e(".play").on("click", function(a) {
        i(e(".list-group-item").index(e(this).parent()))
    }), e(".badge-download").on("shown.bs.dropdown", function() {
        dropdown = e(this), infoEl = e(dropdown.find(".info-link")[0]), link = infoEl.attr("data-stream"), duration = parseInt(e(infoEl).attr("data-duration")), p.bitratesEnabled ? "..." == infoEl.text() && (parts = link.split("/"), length = parts.length, bytesUrl = p.apiUrl + "bytes/" + parts[length - 2] + "/" + parts[length - 1], s(bytesUrl, function(e) {
            bitrate = parseInt(8 * e / duration / 1e3), info = bitrate + " kbps, " + c(e, !0), infoEl.text(info), allowedBitrateClasses = {
                64: "bitrate-64",
                128: "bitrate-128",
                192: "bitrate-192"
            };
            for (var a in allowedBitrateClasses) bitrateEl = dropdown.find("." + allowedBitrateClasses[a]), a >= bitrate ? bitrateEl.remove() : (bytes = a / 8 * duration * 1e3, bitrateEl.text(bitrateEl.text() + ", " + c(bytes, !0)))
        })) : infoEl.text(i18n.t("clickToDownload"))
    }), e(".badge-download a").on("click", function() {
        "#" != e(this).attr("href") && (e(this).hasClass("info-link") ? u("download", "bitrate = default") : (bitrate = e(this).text().replace(/[^\d.]/g, ""), 0 == bitrate.length ? u("download", "bitrate = default") : u("download", "bitrate = " + bitrate)))
    })
}

function o() {
    0 > p.currentTrack || (itemCount = e(".list-group-item").length - 1, p.currentTrack + 1 <= itemCount ? i(p.currentTrack + 1) : (console.log("seems like there no audios to play, i think. playing first one."), i(0)), u("play", "next"))
}

function t() {
    0 > p.currentTrack || (p.currentTrack - 1 >= 0 ? i(p.currentTrack - 1) : (console.log("this is first audio, nothing in back. playing last one."), itemCount = e(".list-group-item").length - 1, i(itemCount)), u("play", "prev"))
}

function i(a) {
    return parent = e(e(".list-group-item")[a]), el = parent.find(".play"), a == p.currentTrack ? void(e("#jquery_jplayer_1").data().jPlayer.status.paused ? (e("#jquery_jplayer_1").jPlayer("play"), e(el).find(".glyphicon").removeClass("glyphicon-play"), e(el).find(".glyphicon").addClass("glyphicon-pause")) : (e("#jquery_jplayer_1").jPlayer("pause"), e(el).find(".glyphicon").removeClass("glyphicon-pause"), e(el).find(".glyphicon").addClass("glyphicon-play"))) : el.length ? (e("#jquery_jplayer_1").jPlayer("setMedia", {
        mp3: e(el).parent().find("a.name").attr("data-src")
    }), e(".jp-audio .jp-current-name").text(e(el).parent().find("a.name").text()), e("#jquery_jplayer_1").jPlayer("play"), e("#jp_container_1").show(), e("#player-space").show(), p.currentTrack = a, e(".list-group").find(".glyphicon-pause").each(function(a, n) {
        e(n).removeClass("glyphicon-pause"), e(n).addClass("glyphicon-play")
    }), e(".list-group-item.active").each(function(a, n) {
        e(n).removeClass("active")
    }), parent.addClass("active"), e(el).find(".glyphicon").removeClass("glyphicon-play"), e(el).find(".glyphicon").addClass("glyphicon-pause"), void u("playAudio", e(e(".list-group-item")[a]).find("a.name").html())) : void console.log("#" + a + " audio not found in dom")
}

function l(a) {
    e("#result > .list-group").html(""), e("#result > .list-group").append('<li class="list-group-item list-group-item-danger">' + a + "</li>"), e("#loading").hide(), e("#loading-more").hide()
}

function r() {
    return paramQuery = d("q"), paramQuery.length > 1 && (a(paramQuery, 0, null, null, !0), e("#query").val(paramQuery), !0)
}

function d(e) {
    e = e.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
    var a = new RegExp("[\\?&]" + e + "=([^&#]*)"),
        n = a.exec(location.search);
    return null === n ? "" : decodeURIComponent(n[1].replace(/\+/g, " "))
}

function s(a, n) {
    e.get(a, function(e) {
        n(parseInt(e))
    })
}

function u(e, a) {
    try {
        ga && ga("send", "event", e, a)
    } catch (e) {
        console.error("outer", e.message)
    }
}

function c(e, a) {
    var n = a ? 1e3 : 1024;
    if (Math.abs(e) < n) return e + " B";
    var o = a ? ["kB", "MB", "GB"] : ["KiB", "MiB", "GiB"],
        t = -1;
    do e /= n, ++t; while (Math.abs(e) >= n && t < o.length - 1);
    return e.toFixed(1) + " " + o[t]
}
e(document).keydown(function(a) {
    if (!e("#query").is(":focus")) {
        var n = a.charCode ? a.charCode : a.keyCode;
        39 == n ? (o(), u("button", "next")) : 37 == n && (t(), u("button", "prev"))
    }
}), e("#player").affix({
    offset: {
        top: 400,
        bottom: function() {
            return this.bottom = e(".footer").outerHeight(!0)
        }
    }
});
var p = {
    title: "datmusic",
    apiUrl: "http://localhost:8000/",
    appUrl: window.location.protocol + "//datmusic.xyz/",
    bitratesEnabled: !0,
    oldQuery: null,
    page: 0,
    defaultLang: "en",
    langCookie: "musicLang",
    currentTrack: -1
};
i18n.init({
    lng: e.cookie(p.langCookie) ? e.cookie(p.langCookie) : p.defaultLang,
    resStore: locales,
    cookieName: p.langCookie
}, function(a, n) {
    e("body").i18n(), p.title = i18n.t("title")
}), e('[data-toggle="tooltip"]').tooltip();
var g = e("#audioTemplate").html();
if (Mustache.parse(g), void 0 === e.cookie("showAndroidDownload")) {
    e.cookie("showAndroidDownload", !1, {
        expires: 2
    });
    var h = navigator.userAgent.toLowerCase(),
        y = h.indexOf("android") > -1;
    if (y) {
        var m = confirm(i18n.t("apkDownload"));
        if (1 == m) {
            u("android", "confirm");
            var f = window.open("https://play.google.com/store/apps/details?id=tm.alashow.datmusic", "_blank");
            f.focus()
        } else u("android", "deny")
    }
}
if (e("#settings").on("click", function(a) {
        e("#settingsModal").modal("show")
    }), e("#languageSelect").val(i18n.lng()), e("#languageSelect").on("change", function(a) {
        i18n.setLng(e(this).val(), function(a, n) {
            e("body").i18n(), title = e("#jp_container_1").attr("title"), e("#jp_container_1").attr("data-original-title", title), e("#jp_container_1").attr("title", "")
        })
    }), e("#query").bind("keypress", function(a) {
        13 == a.keyCode && e(".search").trigger("click")
    }), e(".search").on("click", function(n) {
        typedQuery = e("#query").val(), "" != typedQuery && a(typedQuery, 0, null, null, !0)
    }), e("#load-more").on("click", function(e) {
        next_page = p.page + 1, a(p.oldQuery, next_page, null, null, !0), u("load-more", next_page)
    }), e("#jquery_jplayer_1").jPlayer({
        swfPath: p.appUrl + "js",
        supplied: "mp3",
        wmode: "window",
        smoothPlayBar: !0,
        keyEnabled: !0,
        remainingDuration: !0,
        toggleDuration: !0,
        volume: 1,
        keyBindings: {
            play: {
                key: 32,
                fn: function(e) {
                    u("button", "play/pause"), e.status.paused ? e.play() : e.pause()
                }
            }
        },
        ended: function() {
            itemCount = e(".list-group-item").length, console.log("#" + p.currentTrack + " ended, audios count in dom = " + itemCount), o()
        },
        play: function() {
            currentTrackEl = e(e(".list-group-item")[p.currentTrack]).find(".play"), e(el).find(".glyphicon").addClass("glyphicon-pause"), e(el).find(".glyphicon").removeClass("glyphicon-play")
        },
        pause: function() {
            currentTrackEl = e(e(".list-group-item")[p.currentTrack]).find(".play"), e(el).find(".glyphicon").addClass("glyphicon-play"), e(el).find(".glyphicon").removeClass("glyphicon-pause")
        }
    }), window.onpopstate = function(e) {
        r(), console.log(e)
    }, location.hash.length > 2) {
    var w = decodeURIComponent(escape(window.atob(location.hash.substring(1, location.hash.length))));
    a(w, 0, null, null, !0), e("#query").val(w)
} else if (!r()) {
    var k = ["2 Cellos", "Agnes Obel", "Aloe Black", "Andrew Belle", "Angus Stone", "Aquilo", "Arctic Monkeys", "Avicii", "Balmorhea", "Barcelona", "Bastille", "Ben Howard", "Benj Heard", "Birdy", "Broods", "Calvin Harris", "Charlotte OC", "City of The Sun", "Civil Twilight", "Clint Mansel", "Coldplay", "Daft Punk", "Damien Rice", "Daniela Andrade", "Daughter", "David O'Dowda", "Dawn Golden", "Dirk Maassen", "Ed Sheeran", "Eminem", "Fabrizio Paterlini", "Fink", "Fleurie", "Florence and The Machine", "Gem club", "Glass Animals", "Greg Haines", "Greg Maroney", "Groen Land", "Halsey", "Hans Zimmer", "Hozier", "Imagine Dragons", "Ingrid Michaelson", "Jamie XX", "Jarryd James", "Jasmin Thompson", "Jaymes Young", "Jessie J", "Josef Salvat", "Julia Kent", "Kai Engel", "Keaton Henson", "Kendra Logozar", "Kina Grannis", "Kodaline", "Kygo", "Kyle Landry", "Lana Del Rey", "Lera Lynn", "Lights & Motion", "Linus Young", "Lo-Fang", "Lorde", "Ludovico Einaudi", "M83", "MONO", "MS MR", "Macklemore", "Mammals", "Maroon 5", "Martin Garrix", "Mattia Cupelli", "Max Richter", "Message To Bears", "Mogwai", "Mumford & Sons", "Nils Frahm", "ODESZA", "Oasis", "Of Monsters and Men", "Oh Wonder", "Philip Glass", "Phoebe Ryan", "Rachel Grimes", "Radiohead", "Ryan Keen", "Sam Smith", "Seinabo Sey", "Sia", "Takahiro Kido", "The Irrepressibles", "The Neighbourhood", "The xx", "VLNY", "Wye Oak", "X ambassadors", "Yann Tiersen", "Yiruma", "Young Summer", "Zack Hemsey", "Zinovia", "deadmau5", "pg.lost", "Ólafur Arnalds"],
        b = k[Math.floor(Math.random() * k.length)];
    a(b, 0, null, null, !1, !0), e("#query").val(b)
}
e.getScript("js/app.extra.js"), Number.prototype.toTime = function() {
    var e = parseInt(this, 10);
    return (e - (e %= 60)) / 60 + (9 < e ? ":" : ":0") + e
}

});`

from datmusic.

alashow avatar alashow commented on June 10, 2024

p.apiUrl = http://localhost:8000/ this should be equal with .env APP_URL (change it to http://localhost:8000/)

from datmusic.

tomriddle54 avatar tomriddle54 commented on June 10, 2024

Still the same Error

from datmusic.

alashow avatar alashow commented on June 10, 2024

What error is that? Not found?

from datmusic.

tomriddle54 avatar tomriddle54 commented on June 10, 2024

where should i change p.apiUrl = http://localhost:8000 in app.js but where should i add that

from datmusic.

alashow avatar alashow commented on June 10, 2024

The app.js you commented above has p object (originally config), which has apiUrl key. You set it to http://localhost:8000 which means it's your datmusic-api deployment url. So, change APP_URL in .env to make it same.

from datmusic.

tomriddle54 avatar tomriddle54 commented on June 10, 2024

Yes The Both are same

from datmusic.

tomriddle54 avatar tomriddle54 commented on June 10, 2024

Here is my env code

`APP_ENV=local
APP_DEBUG=true
APP_KEY=
APP_TIMEZONE=UTC
APP_URL=http://localhost:8000

setup redis for faster cache

CACHE_DRIVER=file
QUEUE_DRIVER=sync

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=
REDIS_PORT=6379

set true to enable basic auth

BASIC_AUTH_ENABLED=false
API_USERNAME=
API_PASSWORD=

should not contain any spaces, or plus sign

ACCOUNTS=**************

vk's mp3 url encoding toggle

DATMUSIC_MP3_URL_DECODER=true

full or short path to node js, for decoder

NODEJS_PATH=nodejs

add domains here separated by commas

set to '*' to allow any

CORS_ALLOWED_ORIGINS=datmusic.xyz,localhost

proxy config

PROXY_ENABLE=false
PROXY_IP=
PROXY_PORT=
PROXY_USERNAME=
PROXY_PASSWORD=

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=

mp3 files cdn root url. mp3 files will be appended to this url if set

used only with aws

example: http://sample.cloudfront.net/

CDN_ROOT_URL=
`

from datmusic.

alashow avatar alashow commented on June 10, 2024

What is your error message now?

from datmusic.

tomriddle54 avatar tomriddle54 commented on June 10, 2024

same as before
screenshot_9

from datmusic.

tomriddle54 avatar tomriddle54 commented on June 10, 2024

what i am doing is is
created a folder named mtstudio in htdoc that is in xamp and clone datmusic in mtstudio there i have all file and folder of datmusic and after that i have created another folder called datmusic-api there i cloned datmusic-api and i run xamp after that i run laravel command php -S localhost:8000 -t public/
screenshot_12

from datmusic.

alashow avatar alashow commented on June 10, 2024

Open that url in a new tab

from datmusic.

tomriddle54 avatar tomriddle54 commented on June 10, 2024

Which Url Noting Is Working Please Upload a Guid to run your project with steps because its hard to run or configure

from datmusic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.