Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    urllib2.HTTPError: HTTP Error 403

    Cinema 4D SDK
    python
    3
    4
    1.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • merkvilsonM
      merkvilson
      last edited by

      urllib2 no longer has any effect in Cinema 4D.
      It is worth mentioning that I did not change anything in my code. It was working like a charm.
      I doubt the latest windows update corrupted it.
      Are there any solutions to bypass this limitation?

      Traceback (most recent call last):
        File "C:\Users\Merk\Documents\GIT Projects\c4d_plugins\Symex\symex.pyp", line 74, in <module>
          check.UpdateAtStartUp(version, url, command = 1051407,)
        File "C:\Users\Merk\Documents\GIT Projects\c4d_plugins\Symex\res\modules\checkUpdate.py", line 171, in UpdateAtStartUp
          if NewVersion(version, url,)[0]:
        File "C:\Users\Merk\Documents\GIT Projects\c4d_plugins\Symex\res\modules\checkUpdate.py", line 68, in NewVersion
          htmlsource = urllib2.urlopen(url, cafile=f)
        File "C:\Program Files\MAXON\Cinema 4D R20\resource\modules\python\libs\win64\python27.vs2008.framework\lib\urllib2.py", line 154, in urlopen
          return opener.open(url, data, timeout)
        File "C:\Program Files\MAXON\Cinema 4D R20\resource\modules\python\libs\win64\python27.vs2008.framework\lib\urllib2.py", line 435, in open
          response = meth(req, response)
        File "C:\Program Files\MAXON\Cinema 4D R20\resource\modules\python\libs\win64\python27.vs2008.framework\lib\urllib2.py", line 548, in http_response
          'http', request, response, code, msg, hdrs)
        File "C:\Program Files\MAXON\Cinema 4D R20\resource\modules\python\libs\win64\python27.vs2008.framework\lib\urllib2.py", line 473, in error
          return self._call_chain(*args)
        File "C:\Program Files\MAXON\Cinema 4D R20\resource\modules\python\libs\win64\python27.vs2008.framework\lib\urllib2.py", line 407, in _call_chain
          result = func(*args)
        File "C:\Program Files\MAXON\Cinema 4D R20\resource\modules\python\libs\win64\python27.vs2008.framework\lib\urllib2.py", line 556, in http_error_default
          raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
      urllib2.HTTPError: HTTP Error 403: Forbidden
      
      1 Reply Last reply Reply Quote 0
      • M
        m_adam
        last edited by

        Hi could you share your code, without your code, it's hard to reproduce.
        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 0
        • merkvilsonM
          merkvilson
          last edited by

          Code:

          import c4d, urllib2, os
          
          url = r"https://www.patreon.com/posts/24993001"
          
          f = os.path.join(os.path.dirname(c4d.storage.GeGetStartupApplication()), "resource", "ssl", "cacert.pem")
          
          urllib2.urlopen(url, cafile=f)
          

          Error:

          Traceback (most recent call last):
            File "scriptmanager", line 7, in <module>
            File "C:\Program Files\MAXON\Cinema 4D R20 Demo\resource\modules\python\libs\win64\python27.vs2008.framework\lib\urllib2.py", line 154, in urlopen
              return opener.open(url, data, timeout)
            File "C:\Program Files\MAXON\Cinema 4D R20 Demo\resource\modules\python\libs\win64\python27.vs2008.framework\lib\urllib2.py", line 435, in open
              response = meth(req, response)
            File "C:\Program Files\MAXON\Cinema 4D R20 Demo\resource\modules\python\libs\win64\python27.vs2008.framework\lib\urllib2.py", line 548, in http_response
              'http', request, response, code, msg, hdrs)
            File "C:\Program Files\MAXON\Cinema 4D R20 Demo\resource\modules\python\libs\win64\python27.vs2008.framework\lib\urllib2.py", line 473, in error
              return self._call_chain(*args)
            File "C:\Program Files\MAXON\Cinema 4D R20 Demo\resource\modules\python\libs\win64\python27.vs2008.framework\lib\urllib2.py", line 407, in _call_chain
              result = func(*args)
            File "C:\Program Files\MAXON\Cinema 4D R20 Demo\resource\modules\python\libs\win64\python27.vs2008.framework\lib\urllib2.py", line 556, in http_error_default
              raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
          urllib2.HTTPError: HTTP Error 403: Forbidden
          
          1 Reply Last reply Reply Quote 0
          • ManuelM
            Manuel
            last edited by

            hello,

            we did run a couple of test and seems that the "issue" is on Patreon side.

            HTTP Error 403: Forbidden

            We did try with other url, it work.
            We did try adding header-agent or things like that, it failed.

            They probably changed something on their server that doesn't allow to connect with python with default parameters.
            You have to contact them in order to know what you have to do.

            Cheers
            Manuel

            MAXON SDK Specialist

            MAXON Registered Developer

            1 Reply Last reply Reply Quote 1
            • First post
              Last post