Skip to content

Commit 973fe52

Browse files
authored
Updated constructor/endpoint
1 parent 019db69 commit 973fe52

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

samples/search/video_search_samples.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
from azure.cognitiveservices.search.videosearch import VideoSearchAPI
1+
import os
2+
3+
from azure.cognitiveservices.search.videosearch import VideoSearchClient
24
from azure.cognitiveservices.search.videosearch.models import VideoPricing, VideoLength, VideoResolution, VideoInsightModule
35
from msrest.authentication import CognitiveServicesCredentials
46

57
# Add your Bing Search V7 subscription key to your environment variables.
68
SUBSCRIPTION_KEY = os.environ['BING_SEARCH_V7_SUBSCRIPTION_KEY']
7-
9+
endpoint = os.environ['BING_SEARCH_V7_ENDPOINT']
810

911
def video_search(subscription_key):
1012
"""VideoSearch.
1113
1214
This will search videos for (SwiftKey) then verify number of results and print out id, name and url of first video result.
1315
"""
14-
client = VideoSearchAPI(CognitiveServicesCredentials(subscription_key))
16+
client = VideoSearchClient(ENDPOINT, CognitiveServicesCredentials(subscription_key))
1517

1618
try:
1719
video_result = client.videos.search(query="SwiftKey")

0 commit comments

Comments
 (0)