WordPress.org

Ready to get started?Download WordPress

Forums

Automatic Youtube Video Posts Plugin
Video Descriptions issue (5 posts)

  1. TeeDubz
    Member
    Posted 2 years ago #

    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/

  2. mpraetzel
    Member
    Plugin Author

    Posted 2 years ago #

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

  3. Brian
    Member
    Posted 1 year ago #

    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

  4. pulkitk
    Member
    Posted 1 year ago #

    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.

  5. mpraetzel
    Member
    Plugin Author

    Posted 1 year ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic