Giter Club home page Giter Club logo

Comments (6)

deCodeIt avatar deCodeIt commented on June 12, 2024

I just checked with the following cmd python3 BookMyShow.py -m flash -c forum -d 20230715 -r bang and it works for me on macOS with python3.10.8. I hope you aren't using the old version of this script as requests were blocked in that script.

from book-my-show-notification.

shrihari1999 avatar shrihari1999 commented on June 12, 2024

I downloaded the master branch like an hour ago @deCodeIt . Don't know what's up. I'm on Lubuntu with python 3.7.10

from book-my-show-notification.

deCodeIt avatar deCodeIt commented on June 12, 2024

Can you share the cmd you used to run and perhaps a screen recording of the issue? Maybe I can debug it better then

from book-my-show-notification.

shrihari1999 avatar shrihari1999 commented on June 12, 2024

Okay i will tell you all issues i faced then. I ran the following from Readme (I use venv so python path will be different):
/home/shrihari/.local/share/virtualenvs/book-my-show-notification-5xhw3b3o/bin/python3.7 ./BookMyShow.py --movie "avengers" --cinema "pvr" --date "20190426" --regionCode "BANG" --format "3D"

1. urllib3

Traceback (most recent call last):
  File "./BookMyShow.py", line 3, in <module>
    import requests
  File "/home/shrihari/.local/share/virtualenvs/book-my-show-notification-5xhw3b3o/lib/python3.7/site-packages/requests/__init__.py", line 43, in <module>
    import urllib3
  File "/home/shrihari/.local/share/virtualenvs/book-my-show-notification-5xhw3b3o/lib/python3.7/site-packages/urllib3/__init__.py", line 42, in <module>
    "urllib3 v2.0 only supports OpenSSL 1.1.1+, currently "
ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'OpenSSL 1.0.2g  1 Mar 2016'. See: https://github.com/urllib3/urllib3/issues/2168

So, I had to downgrade urllib3 from 2.0.3 to 1.26.5. Running the script again, since i'm using python 3.7, I run into the following issues

2.1 typing

playsound is relying on another python subprocess. Please use `pip install pygobject` if you want playsound to run more efficiently.
Traceback (most recent call last):
  File "./BookMyShow.py", line 29, in <module>
    from bmsTypes import BMSRegion, City, BMSVenue, Venue, CinemaPageApiResponse
  File "/home/shrihari/Downloads/book-my-show-notification/bmsTypes.py", line 2, in <module>
    from typing import List, Union, Optional, Literal, Dict
ImportError: cannot import name 'Literal' from 'typing' (/usr/lib/python3.7/typing.py)

Let's ignore the playsound log. , in bmsTypes, i had to change

from typing import List, Union, Optional, Literal, Dict

to

from typing import List, Union, Optional, Dict
from typing_extensions import Literal

2.2 typing
Traceback (most recent call last):
File "./BookMyShow.py", line 29, in
from bmsTypes import BMSRegion, City, BMSVenue, Venue, CinemaPageApiResponse
File "/home/shrihari/Downloads/book-my-show-notification/bmsTypes.py", line 81, in
class Category(BaseModel):
File "/home/shrihari/Downloads/book-my-show-notification/bmsTypes.py", line 85, in Category
UpdatedPrice: str | None
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

For this, i had to remove all | None occurences in bmsTypes.py

  1. Blocked
Traceback (most recent call last):
  File "pydantic/main.py", line 539, in pydantic.main.BaseModel.parse_raw
  File "pydantic/parse.py", line 37, in pydantic.parse.load_str_bytes
  File "/usr/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.7/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./BookMyShow.py", line 359, in <module>
    regions = bms.searchRegion( args.regionCode )
  File "./BookMyShow.py", line 204, in searchRegion
    regions = self.fetchRegions()
  File "./BookMyShow.py", line 201, in fetchRegions
    return BMSRegion.parse_raw( data.stdout )
  File "pydantic/main.py", line 548, in pydantic.main.BaseModel.parse_raw
pydantic.error_wrappers.ValidationError: 1 validation error for BMSRegion
__root__
  Expecting value: line 1 column 1 (char 0) (type=value_error.jsondecode; msg=Expecting value; doc=<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
<!--[if IE 7]>    <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->
<!--[if IE 8]>    <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
<head>
<title>Attention Required! | Cloudflare</title>
<meta charset="UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta name="robots" content="noindex, nofollow" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<link rel="stylesheet" id="cf_styles-css" href="/cdn-cgi/styles/cf.errors.css" />
<!--[if lt IE 9]><link rel="stylesheet" id='cf_styles-ie-css' href="/cdn-cgi/styles/cf.errors.ie.css" /><![endif]-->
<style>body{margin:0;padding:0}</style>


<!--[if gte IE 10]><!-->
<script>
  if (!navigator.cookieEnabled) {
    window.addEventListener('DOMContentLoaded', function () {
      var cookieEl = document.getElementById('cookie-alert');
      cookieEl.style.display = 'block';
    })
  }
</script>
<!--<![endif]-->


</head>
<body>
  <div id="cf-wrapper">
    <div class="cf-alert cf-alert-error cf-cookie-error" id="cookie-alert" data-translate="enable_cookies">Please enable cookies.</div>
    <div id="cf-error-details" class="cf-error-details-wrapper">
      <div class="cf-wrapper cf-header cf-error-overview">
        <h1 data-translate="block_headline">Sorry, you have been blocked</h1>
        <h2 class="cf-subheadline"><span data-translate="unable_to_access">You are unable to access</span> bookmyshow.com</h2>
      </div><!-- /.header -->

      <div class="cf-section cf-highlight">
        <div class="cf-wrapper">
          <div class="cf-screenshot-container cf-screenshot-full">
            
              <span class="cf-no-screenshot error"></span>
            
          </div>
        </div>
      </div><!-- /.captcha-container -->

      <div class="cf-section cf-wrapper">
        <div class="cf-columns two">
          <div class="cf-column">
            <h2 data-translate="blocked_why_headline">Why have I been blocked?</h2>

            <p data-translate="blocked_why_detail">This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.</p>
          </div>

          <div class="cf-column">
            <h2 data-translate="blocked_resolve_headline">What can I do to resolve this?</h2>

            <p data-translate="blocked_resolve_detail">You can email the site owner to let them know you were blocked. Please include what you were doing when this page came up and the Cloudflare Ray ID found at the bottom of this page.</p>
          </div>
        </div>
      </div><!-- /.section -->

      <div class="cf-error-footer cf-wrapper w-240 lg:w-full py-10 sm:py-4 sm:px-8 mx-auto text-center sm:text-left border-solid border-0 border-t border-gray-300">
  <p class="text-13">
    <span class="cf-footer-item sm:block sm:mb-1">Cloudflare Ray ID: <strong class="font-semibold">7e6a1a090ddcf3e5</strong></span>
    <span class="cf-footer-separator sm:hidden">&bull;</span>
    <span id="cf-footer-item-ip" class="cf-footer-item hidden sm:block sm:mb-1">
      Your IP:
      <button type="button" id="cf-footer-ip-reveal" class="cf-footer-ip-reveal-btn">Click to reveal</button>
      <span class="hidden" id="cf-footer-ip">183.82.207.193</span>
      <span class="cf-footer-separator sm:hidden">&bull;</span>
    </span>
    <span class="cf-footer-item sm:block sm:mb-1"><span>Performance &amp; security by</span> <a rel="noopener noreferrer" href="https://www.cloudflare.com/5xx-error-landing" id="brand_link" target="_blank">Cloudflare</a></span>
    
  </p>
  <script>(function(){function d(){var b=a.getElementById("cf-footer-item-ip"),c=a.getElementById("cf-footer-ip-reveal");b&&"classList"in b&&(b.classList.remove("hidden"),c.addEventListener("click",function(){c.classList.add("hidden");a.getElementById("cf-footer-ip").classList.remove("hidden")}))}var a=document;document.addEventListener&&a.addEventListener("DOMContentLoaded",d)})();</script>
</div><!-- /.error-footer -->


    </div><!-- /#cf-error-details -->
  </div><!-- /#cf-wrapper -->

  <script>
  window._cf_translation = {};
  
  
</script>

</body>
</html>
; pos=0; lineno=1; colno=1)

Finally, you can see the blocked error as html output

from book-my-show-notification.

deCodeIt avatar deCodeIt commented on June 12, 2024

I believe it's an issue with the openssl package on your system.
BookMyShow uses http1.1 protocol otherwise it'll throw the cloudflare protection page if requested using http1 or http2.

Try upgrading it. You can also try the following cmd to verify what I just said.

With http1.1 -> works
curl --http1.1 'https://in.bookmyshow.com/api/explore/v1/discover/regions' --user-agent 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36'

With http1 -> blocked
curl 'https://in.bookmyshow.com/api/explore/v1/discover/regions' --user-agent 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36'

from book-my-show-notification.

shrihari1999 avatar shrihari1999 commented on June 12, 2024

Okay, thank you. My openssl version is 1.0.2g 1 Mar 2016

But i can't make a system wide change in my one and only desktop environment... as I don't want to break other projects. Sorry I can't try and let you know if upgrading actually works

from book-my-show-notification.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.