WordPress.org

Support

Support » Plugins and Hacks » Automatic Youtube Video Posts Plugin » [Plugin: Automatic Youtube Video Posts Plugin] Video Descriptions issue

[Plugin: Automatic Youtube Video Posts Plugin] Video Descriptions issue

  • Hey guys,

    I’m just having an issue when the plugin automatically posts my youtube channel’s videos. The plugin is grabbing the video’s metadata and title correctly (checked the feed) but when the video is posted, the first letter is always changing to a different letter (usually an E) – e.g. “Sunny Day” is changed to “Eunny Day”. There has been some cases where first letter of the video’s title/name is changed to a random character – e.g. “Sunny Day” is changed to “]unny Day”.

    I’ve tried resetting the plugin and even removing the posts manually in the database but the same thing still happens when I import the videos again.

    Has anyone else encountered this issue before? What can I do to fix this? Is this some sort of caching issue?

    Thanks in advance,
    TeeDubz

    http://wordpress.org/extend/plugins/automatic-youtube-video-posts/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author ternstyle

    @mpraetzel

    I think it’s a parsing issue. Other have reported the issue. I’ll continue to look into this.

    I am having the same issues with the first character being changed on the you tube descriptions. S becomes A, and D becomes W. any thoughts?

    S > A
    D > W

    pulkitk

    @pulkitk

    The problem is in the WP_ayvpp_add_import_posts() function in parse.php.

    I found a quick hack: simply add an extra space before the first character before XML parsing. Since XML parsing screws up the first character, we can discard it with no worries now.

    In the function, in all regex lines (preg_replace) add a space after <![CDATA[ like so:

    $f->body = preg_replace("/(<media\:description[^>\/]*>)/","$1<![CDATA[ ",$f->body);
    $f->body = preg_replace("/(<\/media\:description>)/","]]>$1",$f->body);
    $f->body = preg_replace("/(<title[^>\/]*>)/","$1<![CDATA[ ",$f->body);
    $f->body = preg_replace("/(<\/title>)/","]]>$1",$f->body);
    $f->body = preg_replace("/(<media\:title[^>\/]*>)/","$1<![CDATA[ ",$f->body);
    $f->body = preg_replace("/(<\/media\:title>)/","]]>$1",$f->body);

    Next, find the line
    $s = $a['entry']["media:group"]['media:description'];
    and replace with
    $s = substr($a['entry']["media:group"]['media:description'], 1);

    Again, find this line
    $s = !empty($a['entry']['content']['value']) ? $a['entry']['content']['value'] : $a['entry']['content'];
    and replace with
    $s = !empty($a['entry']['content']['value']) ? substr($a['entry']['content']['value'], 1) : substr($a['entry']['content'], 1);

    That’s it! Refresh and re-import your videos to note the difference!
    The author should note that the other similar function WP_ayvpp_parse_videos() doesn’t have this problem. This should help locate exactly where the problem is occurring.

    Plugin Author ternstyle

    @mpraetzel

    The newest version of the plugin should have solved this issue without the hack. Thank you to pulkitk for helping everyone in the meantime.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Automatic Youtube Video Posts Plugin] Video Descriptions issue’ is closed to new replies.
Skip to toolbar