Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Biography Discussion (Read 231369 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

Re: Biography Discussion

Reply #1026
Wonder what have I won:
Album:
https://www.allmusic.com/album/mag-earwhig!-mw0000019690
Review:
https://www.allmusic.com/album/mag-earwhig!-mw0000019690/reviewAjax
User review:
https://www.allmusic.com/album/mag-earwhig!-mw0000019690/userReviewsAjax

Code: [Select]
function onStateChange(timer, resolve, reject, func = null) {
if (this !== null && timer !== null) { // this is xmlhttp bound
if (this.readyState === 4) {
clearTimeout(timer); timer = null;
if (this.status === 200) {
if (func) {return func(this.responseText);}
else {resolve(this.responseText);}

} else {
if (!func) {reject({status: this.status, responseText: this.responseText});}
}
}
} else if (!func) {reject({status: 408, responseText: this.responseText})}; // 408 Request Timeout
return null;
}

// May be used to async run a func for the response or as promise
function send({method = 'GET', URL, body = void(0), func = null, requestHeader = [/*[header, type]*/], bypassCache = false}) {
const p = new Promise((resolve, reject) => {
let timer = null;
const xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
// https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#bypassing_the_cache
// Add ('&' + new Date().getTime()) to URLS to avoid caching
xmlhttp.open(
method,
URL + (bypassCache
? (/\?/.test(URL) ? '&' : '?') + new Date().getTime()
: '')
);
requestHeader.forEach((pair) => {
if (!pair[0] || !pair[1]) {console.log('HTTP Headers missing: ' + pair); return;}
xmlhttp.setRequestHeader(...pair);
});
if (bypassCache) {
xmlhttp.setRequestHeader('Cache-Control', 'private');
xmlhttp.setRequestHeader('Pragma', 'no-cache');
}
timer = setTimeout((xmlhttp) => {
xmlhttp.abort();
timer = null;
if (!func) { // 408 Request Timeout
let status = 408;
try {status = xmlhttp.status;} catch(e) {}
reject({status, responseText: 'Request Timeout'});
}
}, 30000, xmlhttp);
xmlhttp.onreadystatechange = onStateChange.bind(xmlhttp, timer, resolve, reject, func);
xmlhttp.send(method === 'POST' ? body : void(0));
});
return p;
}


send({method: 'GET', URL: "https://www.allmusic.com/album/mag-earwhig!-mw0000019690/reviewAjax", func: fb.ShowPopupMessage.bind(fb)});

X


Re: Biography Discussion

Reply #1028
 :))
Not going to touch biography code unless I wanna spend an entire day to get what's going on, just to find the single line of code to build an URL xd Also it probably needs somre rework to properly parse the new source.
Have enough on my side, not gonna happen.

Maybe TT wants to do it, who has done some work before on Wil-B's cripts.

Re: Biography Discussion

Reply #1029
Appending reviewAjax isn't entirely reliable. This url has a review...

https://www.allmusic.com/album/desire-i-want-to-turn-into-you-mw0003879034

but this is no good.

https://www.allmusic.com/album/desire-i-want-to-turn-into-you-mw0003879034/reviewAjax

The success rate is probably 20-30% on a handful of albums I've tested so far.

edit: must admit, not tried setting headers yet. I'll test that later.


Re: Biography Discussion

Reply #1030
That's pretty weird yep.
The code is clear about using that though, for any album (and tab)
Also checked the fullURLWithPath variable, and it's the same than the on found at  the original URL.
Code: [Select]
function(e, t = {
  scroll: !0,
  toggle: !0
}) {
  let i = $(this);
  if (!0 === t.scroll && (window.location.hash = "review"), !i.next().hasClass("tabContent")) {
    let e = protocol + urlSubdomain + ".allmusic.com" + fullURLWithPath + "/reviewAjax";
    $('<div class="tabContent review"><div class="loading"></div></div>').insertAfter(this), fetch(e, {
      cache: "no-store"
    }).then((function(e) {
      return e.text()
    })).then((e => {
      document.querySelector(".tabContent.review").innerHTML = e, "no-scroll" === scroll_v7 && ramp.que.push((function() {
        ramp.addUnits([{
          selectorId: "reviewLB",
          type: "leaderboard_btf"
        }]).then((() => {
          ramp.displayUnits()
        }))
      }))
    }))
  }
  handleTabClick(i, t), setActiveSidebarNavItem("review")
}

So it must be something related to the fetch part yep.

Re: Biography Discussion

Reply #1031
Had another look just now and setting a Referer header seems to solve it. I just use https://allmusic.com

While I'm at it, I thinking setting a fake browser as the User-Agent won't hurt either.


Re: Biography Discussion

Reply #1033
I'd already fixed my implementation when I posted yesterday. It's now in the latest release of JSP3.

I can't use modern javascript and my internet access is done via methods built in to my component. Setting headers is like nothing you'd see in anyone else's code.

I think even SMP scripters are stuck using antiquated activex objects for web access/parsing html so I'm not sure if looking at that would help them either??

Re: Biography Discussion

Reply #1034
Setting headers is trivial with the code I put, but there is a huge problem using activeX.

Referer can not be set due to Miscrosoft policies on MSXML2.ServerXMLHTTP.
https://stackoverflow.com/questions/7980911/vba-serverxmlhttp-and-request-header-referer
https://www.autohotkey.com/boards/viewtopic.php?t=9554

So this still retrieve the 404 error.
Code: [Select]
send({
    method: 'GET',
    bypassCache: true,
    requestHeader: [['referer', 'https://www.allmusic.com/album/mag-earwhig!-mw0000019690'],  ['cache', 'no-store'], ['user-agent', 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36']],
    URL: "https://www.allmusic.com/album/mag-earwhig!-mw0000019690/reviewAjax"
})

That means SMP needs an update to make this work, some kind of other activeX, or BIography will have to make use of 'curl.exe' to retrieve data.


Re: Biography Discussion

Reply #1036
Just in case people have not noticed it at the forums, it has already been fixed and Allmusic working fine :)
https://github.com/Wil-B/Biography/releases/tag/v1.4.2
Quote

Biography v 1.4.2 Latest
@Wil-B Wil-B released this 13 Dec 16:09
v1.4.2
4ca106b
Fixed

    AllMusic (thx to @regorxxx)
    Various other issues

Added

    scrollbar: new options (behaviour tab > scroll)
        windows dark mode scrollbar // has to be manually enabled as SMP isn't dark mode aware
        rounded thumb gripper

See the changelog for full info

Re: Biography Discussion

Reply #1037
Just in case people have not noticed it at the forums, it has already been fixed and Allmusic working fine :)
https://github.com/Wil-B/Biography/releases/tag/v1.4.2
Quote

Biography v 1.4.2 Latest
@Wil-B Wil-B released this 13 Dec 16:09
v1.4.2
4ca106b
Fixed

    AllMusic (thx to @regorxxx)
    Various other issues

Added

    scrollbar: new options (behaviour tab > scroll)
        windows dark mode scrollbar // has to be manually enabled as SMP isn't dark mode aware
        rounded thumb gripper

See the changelog for full info

Panel crashes when clicking confirm dialog for tagging files. Anyone else?

Code: [Select]
locale[i] is undefined

File: tagger.js
Line: 294, Column: 11
Stack trace:
  write@tagger.js:294:11
  continue_confirmation@settings.js:655:16
  confirm@popupbox.js:13:9
  setTag@settings.js:660:61
  func@menu.js:561:21
  run@menu.js:112:30
  load@menu.js:98:8
  rbtn_up@menu.js:1054:8
  on_mouse_rbtn_up@callbacks.js:250:6

Re: Biography Discussion

Reply #1038
With 1.4.2 I sometimes get a crash on exit, I've never had that happen with Biography before. Also, for a few artists (so far) Bio images won't download. But they will on 1.4.1.


Re: Biography Discussion

Reply #1040
I think it's random. But two that I can think of were Smashing Pumpkins and Simon and Garfunkel,. They download just fine with 1.4.1 and they probably will download fine for some people using 1.4.2.

By the way, when I delete the folders they still won't download.

Edit: Found another one that won't download: Crosby, Stills, Nash & Young.

Re: Biography Discussion

Reply #1041
It's probably redirects. If you browse the website, Smashing Pumpkins goes to The Smashing Pumpkins and Simon and Garfunkel goes to Simon & Garfunkel.

I have no idea why the previous version works. That's for WilB/other SMP users to figure out. :P

edit: it may be possible to inspect the reponse headers and get the correct url. It's something I need to do to improve the behaviour in my own JScript Panel 3 component. I guess it should be possible with whatever ActiveX object this SMP script uses too.

Re: Biography Discussion

Reply #1042
I think it's random. But two that I can think of were Smashing Pumpkins and Simon and Garfunkel,. They download just fine with 1.4.1 and they probably will download fine for some people using 1.4.2.

By the way, when I delete the folders they still won't download.

Edit: Found another one that won't download: Crosby, Stills, Nash & Young.
In my fb download images for artist:Smashing Pumpkins


Re: Biography Discussion

Reply #1044
Well after doing some more investigating, those same titles (plus more) are not loading on 1.4.1 either.

Now here's the weird thing: As far as 1.4.1 goes, all the artist photos load fine on my Darkone tweak theme, which uses a custom path,...pretty much the same as Georgia Reborn. (Haven't converted 1.4.2 to custom path yet)

But the loading issue with certain artists persists when Biography is installed via the package manager. And yes, I saw srdn's post above.

Furthermore, I have not been getting the crash on exit today.

Strange.

Re: Biography Discussion

Reply #1045
I figured out the issue. It's sort of like the 'bracket bug' that I discovered with both Biography and Georgia Reborn, which were both fixed by the authors.

The problem is the paths are too long, depending of course on where your theme resides. My test themes lie in a number of sub folders. The one test theme, which has Bio installed via the package manager, is the one that gives me problems. The other resides in the same folder but it has custom paths which are much shorter.

The reason only some artist were giving me issues is because of the number of characters in their names. For example, The Alan Parsons Project would not download images, but Alan Parsons would download the images.

So there you have it.


 

Re: Biography Discussion

Reply #1046
Hi everyone and Marry Xmas  :)

I still fight with my DarkOne4Mod v1.0 (SMP) - fb2k v2.1 (Kutuzov edition) - portable. My Biography dont download artist photo. Now is 1.4.2 but with 1.4.1 was this same problem. I read posts which was write befere my. I dont have idea what should do more. Nothing help.

I install fresh copy foobar 2.1 and put JSP3 set Last.fm Bio + Images and photo are downloading without problem.

Someone have idea what can be a problem or what i should have change on settings etc? to starting dowloading photo on DakrOne4Mode.

Re: Biography Discussion

Reply #1047
Hi everyone and Marry Xmas  :)

I still fight with my DarkOne4Mod v1.0 (SMP) - fb2k v2.1 (Kutuzov edition) - portable. My Biography dont download artist photo. Now is 1.4.2 but with 1.4.1 was this same problem. I read posts which was write befere my. I dont have idea what should do more. Nothing help.

I install fresh copy foobar 2.1 and put JSP3 set Last.fm Bio + Images and photo are downloading without problem.

Someone have idea what can be a problem or what i should have change on settings etc? to starting dowloading photo on DakrOne4Mode.
Possible long file path. Try to move foobar2000 folder into root of drive

Re: Biography Discussion

Reply #1048
Might be. JSP3's root folder structure is...

Code: [Select]
profile-path\js_data\artists\ARTIST

SMP Bios is

Code: [Select]
profile-path\foo_spider_monkey_panel\package_data\{BA9557CE-7B4B-4E0E-9373-99F511E81252}\biography-cache\art_img\FIRST_LETTER\ARTIST

Amusingly (or not), SMP just crashed on shutdown for me (not a script error but a proper component crash). I can't remember the last time I saw that happen. :P

Re: Biography Discussion

Reply #1049
Hi everyone and Marry Xmas  :)

I still fight with my DarkOne4Mod v1.0 (SMP) - fb2k v2.1 (Kutuzov edition) - portable. My Biography dont download artist photo. Now is 1.4.2 but with 1.4.1 was this same problem. I read posts which was write befere my. I dont have idea what should do more. Nothing help.

I install fresh copy foobar 2.1 and put JSP3 set Last.fm Bio + Images and photo are downloading without problem.

Someone have idea what can be a problem or what i should have change on settings etc? to starting dowloading photo on DakrOne4Mode.
Possible long file path. Try to move foobar2000 folder into root of drive

I do this. Copy foobar folder in to root hard disk. No efect. Still not downloading photo.