Support » Plugin: Porn Embed » xhamster is not working

  • Resolved Peter

    (@hardpeter4u)


    Hi,

    The xhamster embed handler is not working for some reason.

    I insert this: http://xhamster.com/movies/6212489/showing_3_full_ejaculations.html

    And nothing shows up except the above link.
    Maybe it’s the “.html” part?

    Pornhub is working as well as xvideos. Haven’t tried the other two yet but will shortly.

    Any ideas?
    Thank you,
    Peter

    https://wordpress.org/plugins/porn-embed/

Viewing 4 replies - 1 through 4 (of 4 total)
  • I have same problems with xhamster importer. Is it possibly to fix it and add sexoficator.com tube?

    Thread Starter Peter

    (@hardpeter4u)

    @almendos

    Hey, sexoficator.com is getting their videos from xhamster so I don’t think you can add sexoficator.com as such. You still need xhamster.

    I’ve switched and added codes for these sites to my functions.php file in my theme.
    For xhamster I have used the following which works:

    add_action( 'init', function()
    {
        wp_embed_register_handler( 
            'xhamster', 
            '#https://xhamster\.com/movies/([\d]+)/?#i', 
            'wp_embed_handler_xhamster' 
        );
    
    } );
    
    function wp_embed_handler_xhamster( $matches, $attr, $url, $rawattr )
    {
        $embed = sprintf(
            '<iframe src="http://xhamster.com/xembed.php?video=%1$s" width="510" height="400" frameborder="0" scrolling="no" allowfullscreen></iframe>',
            esc_attr( $matches[1] ) 
         );
    
        return apply_filters( 'embed_xhamster', $embed, $matches, $attr, $url, $rawattr );
    }

    Hope that helps. You can follow the above to add other sites such as xvideos,pornhub, etc.

    Thanks for your help, Peter!

    Looks it works now!

    Anonymous User 14845682

    (@anonymized-14845682)

    Thx Peter for putting work into it 🙂 Did you manage to make a new plugin from it or can you maintain this? I had no time, because I am currently studying C# and programming more in a Desktop Environment. Also my code here is really messed up and not really good from a wordpress point of view.

    Wishing you a great day.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘xhamster is not working’ is closed to new replies.