title: My api youtube doesnt send messages (in python)
body: <p>i try to learn the youtube api with Oauth but i have a problem. I can like a video but when i try to add a commentary, they have no error but nothing is send. there is my code (i'm sorry, he's not really beautiful again)</p>
  <pre><code>def insert_comment(youtube, channel_id, video_id, text):
      insert_result = youtube.commentThreads().insert(
          part=&quot;snippet&quot;,
          body=dict(
              snippet=dict(
                  channelId=channel_id,
                  VideoId=video_id,
                  topLevelComment=dict(
                      snippet=dict(
                          textOriginal=text)
                  )
              )
          )
      ).execute()
  
      comment = insert_result[&quot;snippet&quot;][&quot;topLevelComment&quot;]
      author = comment[&quot;snippet&quot;][&quot;authorDisplayName&quot;]
      text = comment[&quot;snippet&quot;][&quot;textDisplay&quot;]
  
      print(&quot;Inserted comment for %s: %s&quot;%(author, text))
  
  
  
  credentials = None
  if os.path.exists('token.pickle'):
      print('Loading Credentials From File...')
      with open('token.pickle', 'rb') as token:
          credentials = pickle.load(token)
  
  
  # Google's Request
  from google.auth.transport.requests import Request
  
  
  # If there are no valid credentials available, then either refresh the token or log in.
  if not credentials or not credentials.valid:
      if credentials and credentials.expired and credentials.refresh_token:
          print('Refreshing Access Token...')
          credentials.refresh(Request())
      else:
          print('Fetching New Tokens...')
          flow = InstalledAppFlow.from_client_secrets_file(
              'client_secrets.json',
              scopes=[
                  'https://www.googleapis.com/auth/youtube.force-ssl'
              ]
          )
  
          flow.run_local_server(port=8080, prompt='consent',
                                authorization_prompt_message='')
          credentials = flow.credentials
  
          # Save the credentials for the next run
          with open('token.pickle', 'wb') as f:
  
              print('Saving Credentials for Future Use...')
              pickle.dump(credentials, f)
  
  print(credentials.to_json())
  
  youtube = build(&quot;youtube&quot;, &quot;v3&quot;, credentials=credentials)
  youtube.videos().rate(rating='like', id='oXtNAwfPPDE').execute()
  
  insert_comment(youtube, &quot;UC_n0NUFlpVSrQLfxS8uezog&quot;, &quot;oXtNAwfPPDE&quot;, &quot;super&quot;)
  </code></pre>
  <p>and when i launch it, it says me &quot;inserted comment blabla&quot;
  the like functions without problem.</p>
  <p>I really don't understand where is my misstake
  Thanks for helping</p>