Show all playlists that include the current video
< 脚本Dailymotion: "Included By" Feature的反馈
Working fine for me. (Latest Firefox)
Could you give some details of your setup?
Try adding a grant for GM_xmlhttpRequest to the metadata block. That fixed it for me. Add this line at the top of the script:
// @grant GM_xmlhttpRequest
@BillPorter is that Scriptish, GreaseMonkey or other that was failing for you?
I've added the grant for GM_xmlhttpRequest so hopefully this should fix it for those who had issues. I still can't reproduce the issue on latest stable Firefox with recent versions of either GreaseMonkey or Scriptish. Perhaps older versions of GreaseMonkey?
I'm using GreaseMonkey 2.1 and Firefox 31.0. It's surprising you don't need the grant, I thought GreaseMonkey 2.0 and up defaulted to @grant none. Earlier versions tried to auto-detect required grants.
http://wiki.greasespot.net/@grant
Everything works now except the two next buttons do not work. Using GreaseMonkey 2.1 and Firefox 31.0.
Everything works now except the two next buttons do not work. Using GreaseMonkey 2.1 and Firefox 31.0.
@finderfact2015 Could you please give me an example DailyMotion video URL that demonstrates the issue?
Ok, I think I figured out what's going on :-)
I have both GreaseMonkey 2.1 and Scriptish 0.1.11 installed on my dev box. I *had* been using another addon (of my own making) to manage enabling and disabling of each of them (and to sync scripts between them). It would appear that that addon wasn't successfully disabling Scriptish (ever) when enabling GreaseMonkey, and that GreaseMonkey was always too late (Scriptish got in first!).
The upshot is that I've actually only been testing Scriptish, and not GreaseMonkey :-(
Now that I've *actually* debugged the userscript against GreaseMonkey 2.1 I can see quite easily that the issue is that use of unsafeWindow has been deprecated by Firefox (since version 30) and that GreaseMonkey doesn't do anything interesting to patch it (Scriptish does something here that allows scripts using unsafeWindow to keep working -- not sure how).
In any case, use of unsafeWindow is no-longer necessary for either GreaseMonkey or Scriptish, so I've modified the userscript to avoid it completely :-)
This should fix that "Can't click Next" issue.
Additionally, whily debugging, I noticed a longstanding bug in supplying the page number to the dailymotion API -- this would have caused skipping every second page in the forward direction. :-/ That should also now be fixed!
If everyone could please test with 0.9.9, I would appreciate it greatly.
Great thanks David, works perfectly on Scriptish! Really appreciate that you fixed it.
It works great. Thanks for uploading this. Now if only I could find out why you need to use "data-src" to get the src URL instead of just "src".
As you can tell, I use the HTML version of the playlist to get the image/owner data.
In previous versions the image wasn't loaded that way (i.e: the image was asyncronously loaded using javascript based on the "data-src" attribute) -- no idea why.
Eventually they changed it, and it was *slightly* less effort to remove 8 characters than to remove 15 and add 4 :-)
Sorry, I didn't mean "you" specifically. I actually meant why did I have to use data-src. I tried to get your script to work before you updated it.
After I drilled down through the response text in the getPlaylistDetails function to get to the preview image element from the first video in the playlist I passed 'src' to the attr() method and it didn't work. Instead of getting the URL for the image I kept getting the same string:
data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=
When I finally passed 'data-src' to attr() instead I got the expected URL of the .jpg file.
So I was just curious why src didn't work since that is the name of the attribute. This is a sample of the HTML for an image element in the playlist:
<img class="preview" src="http://s2.dmcdn.net/FFveJ/193x108-e_G.jpg" title="The Beatles - Help! (1965)[Full Album HD]" alt="The Beatles - Help! (1965)[Full Album HD]">
@BillPorter ... understood. When I was originally developing this userscript, I noted tht the DOM looked signficantly different that the page source for playlist pages. (It's probably the same throughout).
Basically, the src attribute holds a base64 encoded placeholder image. The data-src attribute appears to be read and set onto the corresponding src attribte with JavaScript *after* the page has loaded.
I *had* thought that this was an older behaviour and that now both attributes were present in the page source... alas, my memory was fault here. Only the data-src attribute is available.
Sorry to be a bug, but seems to not be working again. Would appreciate your help :)
Oops nevermind, works now after resetting Firefox! :)
@finderfact2015. Are you using Greasemonkey or Scriptish? I've started a new discussion topic for a known issue with Scriptish 0.1.11 and Firefox 32.0 (released yesterday).
Not working
Hi, currently I can't get the feature to work. Would love if it could be fixed! Thanks for your time.