title: Scraping PornHub Video redirects to Cornhub
body: <p>I am making my first steps in webscraping and wanted to get Video Data from Pornhub.</p>
  <p>In a first step i went trough all the pages on the main page and collected the video links. This worked and i got a csv with around 100k links. If i copy/paste those links to the brower , those work fine. BUT, when i go over them with my script to get my desired values, it always redirects me to a Cornhub Video (i know this was an april fools day joke some time ago). So it seems that my request gets redirected, but i dont know how this happens and if i can do anything about it.</p>
  <p>'''with open(&quot;links.csv&quot;, &quot;r&quot;) as f:
  lines = csv.reader(f)</p>
  <pre><code>for adress in lines:
     
      data = []
      print(data)
      headers = ({'User-Agent':
                  'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36'})
  
  
      sleep(randint(2,5))
     
  
      html = requests.get(adress[0], headers=headers)
      soup = BeautifulSoup(html.text, features=&quot;html.parser&quot;)
  
      print(soup)
  
     
      views = soup.find(&quot;script&quot;, type=&quot;application/ld+json&quot;)
  
      json_data = json.loads(views.contents[0])
  
      interaction_stat = json_data[&quot;interactionStatistic&quot;]
      views = int(interaction_stat[0]
                  [&quot;userInteractionCount&quot;].replace(&quot;,&quot;, &quot;&quot;))
  
      duration = int(
          soup.find(&quot;meta&quot;, property=&quot;video:duration&quot;).get(&quot;content&quot;))
  
      upload_date = datetime.datetime.strptime(
          json_data[&quot;uploadDate&quot;][0:10], '%Y-%m-%d').date()
  
      video_id = soup.find(&quot;form&quot;, id=&quot;shareToStream&quot;)
      video_id = video_id.find(&quot;input&quot;, id=&quot;attachment&quot;).get(&quot;value&quot;)
  
      data.append(video_id)
      data.append(upload_date)
      data.append(views)
      data.append(duration)
  
      with open(&quot;data.csv&quot;, &quot;a&quot;, newline=&quot;&quot;) as f:  # Das hier über die schleife um es nur einmal zu machen
          writer = csv.writer(f) 
          writer.writerow(data)
  </code></pre>
  <p>'''</p>