Note that there are some explanatory texts on larger screens.

plurals
  1. POYoutube Send Private Message via Post
    primarykey
    data
    text
    <p>I'm trying to make a Post Method in the private message of Youtube.</p> <p>Heres the URL "All urls have removed dots and http:// to prevent this question to be blocked as a spam"</p> <pre class="lang-none prettyprint-override"><code>www_youtube_com/inbox?feature=mhee&amp;folder=messages </code></pre> <p>In C# I Already made the "login" post method, here's the snippet:</p> <pre class="lang-vb prettyprint-override"><code>Dim url As String = "https://accounts.google.com/ServiceLogin?passive=true&amp;hl=pt_BR&amp;service=youtube&amp;continue=https%3A%2F%2Fwww.youtube.com%2Fsignin%3Faction_handle_signin%3Dtrue%26feature%3Dsign_in_button%26hl%3Dpt_BR%26next%3D%252F%26nomobiletemp%3D1&amp;uilel=3" Dim formUrl As String = url Dim formParams As String = String.Format("Email={0}&amp;Passwd={1}", "*********", "**********") Dim cookieheader As String Dim req As WebRequest = WebRequest.Create(formUrl) req.ContentType = "application/x-www-form-urlencoded" req.Method = "POST" Dim bytes() As Byte = Encoding.ASCII.GetBytes(formParams) req.ContentLength = bytes.Length Using os As Stream = req.GetRequestStream() os.Write(bytes, 0, bytes.Length) End Using Dim resp As WebResponse = req.GetResponse() cookieheader = resp.Headers("Set-cookie") cookies.SetCookies(resp.ResponseUri, resp.Headers("Set-cookie")) resp.Close() 'starts sending msg Dim httpreq As HttpWebRequest = WebRequest.Create("http://www.youtube.com/inbox_ajax") httpreq.ContentType = "application/x-www-form-urlencoded" httpreq.Method = "POST" formParams = String.Format("action_ajax=1&amp;type=send_message&amp;message_text={2}&amp;subject={1}&amp;to_users={0}&amp;video_id={3}", "user", "subject", "message_body", "videoid") bytes = Encoding.ASCII.GetBytes(formParams) httpreq.ContentLength = bytes.Length httpreq.CookieContainer = cookies httpreq.Headers.Add("Cookie", cookieheader) Using os As Stream = httpreq.GetRequestStream() os.Write(bytes, 0, bytes.Length) End Using resp = httpreq.GetResponse() </code></pre> <p>The user, subject, message_body, and videoid fields were filled with real data to be correctly tested...</p> <p>I Already tried to change sometimes the HTTPREQ URL, so it could match the youtube form website, but, using firebug, i catch those informations:</p> <p>URL that the post occur when I do it manually in the Firefox using Firebug: </p> <pre class="lang-none prettyprint-override"><code>www_youtube_com/inbox_ajax?action_ajax=1&amp;type=send_message </code></pre> <pre class="lang-none prettyprint-override"><code>Message Parameters: [{"type":"send_message","request":{"message_text":"Test6","subject":"Test5","to_users":"HTDANILO","video_id":"ph0TNYQllRQ"}}] </code></pre> <p>The firebug also says that the Referer site is:</p> <pre class="lang-none prettyprint-override"><code>www_youtube_com/inbox?feature=mhee&amp;folder=messages </code></pre> <p>But I already tried to do the post in there, also tried in <a href="http://www.youtube.com/inbox" rel="nofollow">http://www.youtube.com/inbox</a>, neither worked.</p> <p>Someone could point me so i can understand why it isnt working?</p> <p>Sorry for bad English, not my native language and thanks in advice!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload