Skip to content

Commit b29fe1d

Browse files
Merge pull request geekcomputers#493 from ccppoo/patch-2
Update get_youtube_view.py
2 parents 139c5ce + 53556df commit b29fe1d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

get_youtube_view.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#adding ability to change number of repeats
1414
count = int(input("Number of times to be repeated: "))
1515
#Same as before
16-
x = input("Enter the URL (no https): ")
16+
url = input("Enter the URL : ")
1717
print( "Length of video:")
1818
minutes = int(input("Minutes "))
1919
seconds = int(input("Seconds "))
@@ -22,9 +22,13 @@
2222
refreshrate = minutes * 60 + seconds
2323
#Selecting Safari as the browser
2424
driver = webdriver.Safari()
25-
driver.get("http://"+x)
2625

27-
for i in range(count):
26+
if(url.startswith("https://"):
27+
driver.get(url)
28+
else:
29+
driver.get("https://"+url)
30+
31+
for _ in range(count):
2832
#Sets the page to refresh at the refreshrate.
2933
time.sleep(refreshrate)
3034
driver.refresh()

0 commit comments

Comments
 (0)