Thread Starter
cspit
(@cspit)
I was able to get further with this by bringing up the form on a dedicated page (ignore some of the extra lines with the ID.).
<?php
$dir='/var/www/html/wordpress';
$full="$dir/wp-load.php";
require_once $full;
$u=get_user_by('email', 'user@domain');
$uid=$u->ID;
echo get_wp_user_avatar($uid);
echo do_shortcode('[avatar_upload user="user"]');
?>
However, when I try to use any of the buttons nothing happens. My hope is to use a custom form that python sessions can interact with.
Thread Starter
cspit
(@cspit)
I found the problem. I was not pulling the correct nonce.
Updated to use the following now allows me to upload files.
test = re.search('"multipart_params":.*_wpnonce":"[0-9a-z]+"', r1.text)
nonce = re.search('(?<=_wpnonce":")[0-9a-z]{10}', test.group(0))
nonce = nonce.group(0)