vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Add-On Releases - DJ's AME (Auto Media Embedding) XML Media Definitions (Third Time's the Charm) (https://vborg.vbsupport.ru/showthread.php?t=175378)

toastyman 11-06-2008 06:56 PM

I'm having a problem with the blip.tv code from the latest version. Using one of the examples given in the first reply, when I try to embed http://blip.tv/file/591048 I get:

Code:

2008-11-06 20:53:17: (mod_fastcgi.c.2592) FastCGI-stderr: PHP Parse error:  syntax error, unexpected '(' in includes/ame_bbcode.php(323) : regexp code on line 1
PHP Fatal error:  preg_replace() [<a href='function.preg-replace'>function.preg-replace</a>]: Failed evaluating code:
ame_match(&quot;http://blip.tv/file/591048&quot;, &quot;&quot;, 1, &quot;~[\s]+player\.setPostsId\(([\d]+)\);[\s]+player\.setUsersId\([\d]+\);[\s]+player\.setUsersLogin\(&quot;([\w-_]+)&quot;\)~sim&quot;, &quot;&quot;,$ameinfo) in includes/ame_bbcode.php on line 323

Happy to help test anything!

Digital Jedi 11-07-2008 02:10 AM

Quote:

Originally Posted by realmr (Post 1660357)
can u include x-videos.com into the list ? I heard members are using this feature and they wanted this one of my adult forum

I'm not sure, but there may already be one for X-Videos. Go back to the AME 2.0 thread and look for the Add-On section towards the bottom of the mod. The link to the Adult XMLs is listed right there with this one.


Quote:

Originally Posted by skcyber (Post 1660360)
here is the jiwa.fr music player ! ;)

Is this different from the one I just posted? I havn't had a chance to look at it yet.


Quote:

Originally Posted by simunaqv (Post 1660652)
Hi DJ,

I am trying to create a definition for scribd as in the following but it is not working:

HTML Code:

<?xmlversion="1.0"encoding="ISO-8859-1"?>
<AME>
<item>
<id>155</id>
<title>Scribd</title>
<description>Embed Scribd Documents</description>
<displayorder>1</displayorder>
<findcode><![CDATA[http://www\.scribd\.com/doc/[\w]+/[\w-]+]]></findcode>
<replacecode><![CDATA[<a title="$title" href="$url" style="display: block;">$title</a> <object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" id="doc_110081542045067" name="doc_110081542045067" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" align="middle" height="500" width="100%"> <param name="movie" value="http://documents.scribd.com/ScribdViewer.swf?document_id=$p1"> <param name="quality" value="high"> <param name="play" value="true"> <param name="loop" value="true"> <param name="scale" value="showall"> <param name="wmode" value="opaque"> <param name="devicefont" value="false"> <param name="bgcolor" value="#ffffff"> <param name="menu" value="true"> <param name="allowFullScreen" value="true"> <param name="allowScriptAccess" value="always"> <param name="salign" value=""> <embed src="http://documents.scribd.com/ScribdViewer.swf?document_id=$p1" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" play="true" loop="true" scale="showall" wmode="opaque" devicefont="false" bgcolor="#ffffff" name="doc_110081542045067_object" menu="true" allowfullscreen="true" allowscriptaccess="always" salign="" type="application/x-shockwave-flash" align="middle" height="500" width="100%"></embed> </object> <div style="none; display: block;"> <a href="http://www.scribd.com/upload" style="text-decoration: underline;">Get your own</a> at Scribd or <a href="http://www.scribd.com/browse" style="text-decoration: underline;">explore</a> others: </div>]]></replacecode>
<status>1</status>
<container>1</container>
<embedregexp><![CDATA[http://documents\.scribd\.com/ScribdViewer\.swf\?document_id=([\w-]+&access_key=[\w-]+&page=)]]></embedregexp>
<extraction>1</extraction>
<gdef>0</gdef>
</item>
</AME>

The embedded regular expression is not returning anything although it appears to be correct. Could you please have a look?

First, ensure extraction is also on in the Global Settings for AME. Then check to see that your Embed Regexp can actually pull the data from the source of the page. One of the mistakes I almost always make is to presume that because the embed code is located in the page, that it will also be in the Source Code HTML of the page, which is where the Emebed Regexp actually looks. But often that isn't the case, so the RegEx can't find a match. But most of the time you can get around that by checking to see if the numbers/letters/IDs you need are located in the Source HTML somewhere and match them instead of trying to match patterns in the embed code. It will still work, because the variables will still parse to their corresponding group.



Quote:

Originally Posted by toastyman (Post 1660701)
I'm having a problem with the blip.tv code from the latest version. Using one of the examples given in the first reply, when I try to embed http://blip.tv/file/591048 I get:

Code:

2008-11-06 20:53:17: (mod_fastcgi.c.2592) FastCGI-stderr: PHP Parse error:  syntax error, unexpected '(' in includes/ame_bbcode.php(323) : regexp code on line 1
PHP Fatal error:  preg_replace() [<a href='function.preg-replace'>function.preg-replace</a>]: Failed evaluating code:
ame_match(&quot;http://blip.tv/file/591048&quot;, &quot;&quot;, 1, &quot;~[\s]+player\.setPostsId\(([\d]+)\);[\s]+player\.setUsersId\([\d]+\);[\s]+player\.setUsersLogin\(&quot;([\w-_]+)&quot;\)~sim&quot;, &quot;&quot;,$ameinfo) in includes/ame_bbcode.php on line 323

Happy to help test anything!

Heh, that threw me for a minute. This exact Bridgetdale video is the one I use for my base test.

Are you using AME 2.5? I think Blip has some trouble with new BETA.

simunaqv 11-07-2008 07:14 AM

Quote:

Originally Posted by Digital Jedi (Post 1660911)

First, ensure extraction is also on in the Global Settings for AME. Then check to see that your Embed Regexp can actually pull the data from the source of the page. One of the mistakes I almost always make is to presume that because the embed code is located in the page, that it will also be in the Source Code HTML of the page, which is where the Emebed Regexp actually looks. But often that isn't the case, so the RegEx can't find a match. But most of the time you can get around that by checking to see if the numbers/letters/IDs you need are located in the Source HTML somewhere and match them instead of trying to match patterns in the embed code. It will still work, because the variables will still parse to their corresponding group.

Hi DJ,
Can you give me an example of how patterns can be matched in source HTML?

skcyber 11-07-2008 08:05 AM

Quote:

Originally Posted by Digital Jedi (Post 1660911)
Is this different from the one I just posted? I havn't had a chance to look at it yet.

Yes ! the one you have posted is for playlists and mine is for tracks ! ;)

Digital Jedi 11-07-2008 11:40 AM

Quote:

Originally Posted by simunaqv (Post 1661024)
Hi DJ,
Can you give me an example of how patterns can be matched in source HTML?

Just look at the source code in your browser (View >> Source) and look for the numbers/letters you need (use the Find option in whatever program opens up the source code). Build your Embed Regexp to match the area where the ID number appears in the code consistently. Group the area in the RegEx that needs to be referenced and put the $ variable wherever that group should go in the Replacement HTML It's going to be different for every site, so there's no real example. Take a look at the extraction RegEx for a bunch of different definitions and you'll see that it's almost always something unique to the website.

Best I could compare it to is, say you need an ID number for the embed code that isn't in the URL string. Say your embed code's video source is www.video.com/vidID=123456.flv. Well, 123456 isn't in the URL. The URL just says www.video.com/u/wow-what-a-dog!.html. So your going to have to look for 123456 in the source code. Thing is, www.video.com/vidID=123456.flv is not in the HTML of the page either. So you have to get those numbers some other way.

You look at the source code of a few pages and you notice that the vidID is there in the pages, it's just not like it is in the embed code. In this hypothetical example lets say it's found like this in the source of the page: src="/getplayer/v=id123456.flv"

So, you build your RegEx to match this for the extraction RegEx: src="/getplayer/v=id([\d]+)\.flv I grouped the area with ID number because that's what I'm going to refrence in my embed code. So that part in the embed code Replacement HTML will look like www.video.com/vidID=$p1.flv

simunaqv 11-07-2008 08:03 PM

DJ, sincere thanks for your help. I was able to create the definition for scribd. Here it is.. :)

Digital Jedi 11-10-2008 02:53 AM

Thank you simunaqv and skcyber. I've included them in this update.

Quote:

Originally Posted by ShiZoPhreN (Post 1658359)
Thanks :)

but no http://zipd.de/ :( thats bad..

I'm working on it, but there is some trouble with the backreference process.

Digital Jedi 11-10-2008 03:02 AM

***UPDATES (Part 2)***
This of this an addendum to the last update. Individual files have now been added to the Main ZIP. However, I'd advise a complete re-import of the Master XML from the main post, as I've started using a different naming convention for a lot of definitions. I will no longer be combining shared definitions into one XML file. As a result, those of you using AME with keys will likely get some duplicate definitions on import. If you plan on doing any adding to your definitions, please look over what your doing first to make sure you not duplicating anything, or just delete everything and import the new Master XML I just added. It will be less time consuming in the long run.

Rickways 11-10-2008 05:34 PM

Hello i'm trying to embed my own MP3

i put in regular expression:
([http://]*[\w]*[\.]*lespoemes\.net\.[\w/&;%-\.]+\.mp3)
and i've put ? mp3 in http://www.lespoemes.net
this mp3 is 18.mp3

When i'm trying in message to put
http://www.lespoemes.net/18.mp3 that doesn't work...?????
What can i do ?

Digital Jedi 11-10-2008 09:16 PM

When you imported the MP3 definition, the only thing you should have changed was YOUR_SITE_NAME_HERE to lespoemes. Not lespoemes.net. Remove the .net.


All times are GMT. The time now is 12:11 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01936 seconds
  • Memory Usage 1,797KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_html_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete